[BUGFIX] Add pid column to extension manager tables
authorHelmut Hummel <typo3@helmut-hummel.de>
Fri, 12 Oct 2012 11:03:24 +0000 (13:03 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Fri, 12 Oct 2012 11:22:41 +0000 (13:22 +0200)
Extbase relies on the pid column to exist for all
persistent domain models.

Add this column and at the same time ignore it
in created queries.

Change-Id: I2b23f44685b7a6712663458b6a776ec7870cf802
Resolves: #41917
Releases: 6.0
Reviewed-on: http://review.typo3.org/15520
Reviewed-by: Oliver Hader
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/extensionmanager/Classes/Domain/Repository/ExtensionRepository.php
typo3/sysext/extensionmanager/Classes/Domain/Repository/RepositoryRepository.php
typo3/sysext/extensionmanager/ext_tables.sql

index 00d9063..8e9cf7e 100644 (file)
@@ -48,6 +48,18 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
        }
 
        /**
+        * Do not include pid in queries
+        *
+        * @return void
+        */
+       public function initializeObject() {
+               /** @var $defaultQuerySettings \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface */
+               $defaultQuerySettings = $this->objectManager->create('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface');
+               $defaultQuerySettings->setRespectStoragePage(FALSE);
+               $this->setDefaultQuerySettings($defaultQuerySettings);
+       }
+
+       /**
         * Count all extensions
         *
         * @return integer
@@ -61,7 +73,7 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
        /**
         * Finds all extensions
         *
-        * @return array|Tx_Extbase_Persistence_QueryResultInterface
+        * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
         */
        public function findAll() {
                $query = $this->createQuery();
index fa50ca4..945ea89 100644 (file)
@@ -33,6 +33,18 @@ namespace TYPO3\CMS\Extensionmanager\Domain\Repository;
 class RepositoryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
 
        /**
+        * Do not include pid in queries
+        *
+        * @return void
+        */
+       public function initializeObject() {
+               /** @var $defaultQuerySettings \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface */
+               $defaultQuerySettings = $this->objectManager->create('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface');
+               $defaultQuerySettings->setRespectStoragePage(FALSE);
+               $this->setDefaultQuerySettings($defaultQuerySettings);
+       }
+
+       /**
         * Updates ExtCount and lastUpdated in Repository eg after import
         *
         * @param integer $extCount
index f3a3c2a..a2ef594 100644 (file)
@@ -3,6 +3,7 @@
 #
 CREATE TABLE tx_extensionmanager_domain_model_repository (
   uid int(11) unsigned NOT NULL auto_increment,
+  pid int(11) unsigned DEFAULT '0' NOT NULL,
   title varchar(150) NOT NULL default '',
   description mediumtext,
   wsdl_url varchar(100) NOT NULL default '',
@@ -17,6 +18,7 @@ CREATE TABLE tx_extensionmanager_domain_model_repository (
 #
 CREATE TABLE tx_extensionmanager_domain_model_extension (
   uid int(11) NOT NULL auto_increment,
+  pid int(11) unsigned DEFAULT '0' NOT NULL,
   extension_key varchar(60) NOT NULL default '',
   repository int(11) unsigned NOT NULL default '1',
   version varchar(10) NOT NULL default '',