0
votes

I'm upgrading a TYPO3 LTS 6.2 to LTS 7.6 now.

I have an extension (extExtended) that extended News extension with new fields and new actions. Everything is working great (BE, FE and DB).

I made an other extension(extSearch) that extended News with search functions.

My search actions return nothing because the database table in the query is not the one of the News. It's looking for a table named after the extSearch extension.

So extExtended->EventController extends GeorgRinger\News\Controller, extExyended->NewsRepository extends GeorgRinger\News\Domain\Repository\NewsRepository

extSearch->SearchController extends GeorgRinger\News\Controller

What am I missing?

2

2 Answers

0
votes

you need a model:

namespace <Vendor>\<Extkey>\Domain\Model;

/**
 * Class Page
 * @package <Vendor>\<Extkey>\Domain\Model
 */
class Page extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {

    /**
     * @var string
     */
    protected $title;

    /**
     * @var string
     */
    protected $subtitle;

    public function getTitle() {
    return $this->title;
    }

    public function getSubtitle() {
        return $this->subtitle;
    }
}

a repository:

namespace <Vendor>\<Extkey>\Domain\Repository;

/**
 * Class PageRepository
 *
 * @package <Vendor>\<Extkey>\Domain\Repository
 */
class PageRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {

    public function findPages() {
    $query = $this->createQuery();
//      $query->getQuerySettings()->setRespectStoragePage(FALSE);

    return $query->execute();
    }
}

and map the table via typoscript:

plugin.tx_<extkey> {
    persistence {
        storagePid = 2
    classes {
        <Vendor>\<Extkey>\Domain\Model\Page {
                mapping {
            tableName = pages
        }
            }
    }
    }
}
0
votes

I place this TypoScript in my extExtended setup and it works

config.tx_extbase {
    persistence {
        Vendor\extensionKey\Domain\Model\News {
            mapping {
                tableName = tx_news_domain_model_news
            }
        }
    }
}