extbase

TYPO3 Extbase: update record with logging of changes

泪湿孤枕 提交于 2019-12-02 09:50:42
When I update an object with an Extbase repository (e.g. in a cronjob or in the frontend) like this... $myRepository->update($myObject); and afterwards I use button "Display change history / Un-do" for this record in TYPO3 BE, I don't see any history. I only see a history when editing the object in TYPO3 BE. How can I enable the history? Short version: you can't, because the history is for changes done in the backend interface only. Longer version: you sort of, kind of can, but that would involve quite a bit of custom code in your repository which would do one of two things: Override the

Use other than primary key as RealURL id_field

不想你离开。 提交于 2019-12-02 09:23:25
In a TYPO3 6.2 site, I have the following postVarSets in realurl_conf.php for an extbase extension: 'postVarSets' => array( '_DEFAULT' => array( 'wba' => array( array( 'GETvar' => 'tx_weiterbildung_pi1[item]' , 'lookUpTable' => array( 'table' => 'tx_weiterbildung_domain_model_item', 'id_field' => 'uid', 'alias_field' => 'kurs_titel', 'addWhereClause' => ' AND NOT deleted', 'useUniqueCache' => 1, 'useUniqueCache_conf' => array( 'strtolower' => 1, 'spaceCharacter' => '-', ), ), ), ), ), ), This works. As the data in this table is imported from another site, I realized that to avoid confusion, I

use removeAll() in scheduler task

喜欢而已 提交于 2019-12-02 07:19:50
Before doing new stuff, i want my scheduler-Task to remove all entries from the database, the execute-function looks like that: public function execute() { $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager'); $jobRepository = $objectManager->get('\TYPO3\MyExtension\Domain\Repository\JobRepository'); //clear DB $jobRepository->removeAll(); (...)//insert new entries to DB $objectManager->get('TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface')->persistAll(); return true; } inserting new entries to the DB works fine, but clearing

get TYPO3 Extbase Repository items in other languages

ε祈祈猫儿з 提交于 2019-12-01 21:49:58
How can i get items from an extbase respository in a different language? What i tested: findByUid($childUid) $query->getQuerySettings()->setRespectSysLanguage(FALSE); $query->getQuerySettings()->setSysLanguageUid(3); But the result is always the parent (lang) object. I tried it with "matching" and with "statement" but the result query uses the active language or searches for sys_language_id in (0,-1) = (default/all). It seems that this is a bug in extbase which will not removed until TYPO3 7.1: https://forge.typo3.org/issues/45873 For me this solves the problem: https://forge.typo3.org/issues

Typo3 Extbase Repository->findAll() returns empty

最后都变了- 提交于 2019-12-01 18:31:45
I just can't findAll() make return anything even though I am able to access a specific record by findByUid() . I have taken note (and tried to workaround / set up) of the typoscript solution and the record storage page bug without any success. I am using a dummy extension code made by the extension builder in TYPO3 (current version) for your convenience. I have tested with data manually added through the TYPO3 config ui. Any help would be much appreciated. All the best and thanks in advance Mario biesior For 99.9 % you didn't set your storagePid properly, it has to be the PID of the page where

Mapping to “pages” table from Extbase in TYPO3 6.1

落爺英雄遲暮 提交于 2019-12-01 17:55:19
I created an extension with a domain model Message . This model has a relation m:n with the TYPO3 pages (the one which has the details of the pages, like title, issite_root etc) table. However, by using the mapping to existing tables option, it gives me type error saying page : The configured type field for table "pages" is of type int(11) unsigned This means the type field can not be used for defining the record type. You have to configure the mappings yourself if you want to map to this table or extend the correlated class So I just create the relation without mapping, so that I can later

Extbase Model: setSysLanguageUid not working

人盡茶涼 提交于 2019-12-01 14:47:04
I created an extbase model and try to set the sys_language_uid field when creating a new item. For some reason though, it is completely ignored and always set to 0, even when the value I try to enter is definitely 1. My Model looks like this: class Ad extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { /** * sysLanguageUid * * @var integer */ protected $sysLanguageUid; /** * @return int */ public function getSysLanguageUid() { return $this->sysLanguageUid; } /** * @param int $sysLanguageUid */ public function setSysLanguageUid($sysLanguageUid) { $this->sysLanguageUid = $sysLanguageUid; }

Extbase Model: setSysLanguageUid not working

不问归期 提交于 2019-12-01 12:27:51
问题 I created an extbase model and try to set the sys_language_uid field when creating a new item. For some reason though, it is completely ignored and always set to 0, even when the value I try to enter is definitely 1. My Model looks like this: class Ad extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { /** * sysLanguageUid * * @var integer */ protected $sysLanguageUid; /** * @return int */ public function getSysLanguageUid() { return $this->sysLanguageUid; } /** * @param int

TYPO3 StoragePid and Current

白昼怎懂夜的黑 提交于 2019-12-01 11:40:24
问题 i build a simple commentary extbase extension, which i want to include with typoscript in a project extension (also extbase). The fluid code in the project extension looks like this: <f:for each="{project.reports}" as="report"> ...Content... {report -> f:cObject(typoscriptObjectPath: 'lib.comments')} </f:for> "Reports" is an array of id's. The lib.comments typoscript looks like this: lib.comments = USER lib.comments { userFunc = tx_extbase_core_bootstrap->run extensionName = Comments

TYPO3 Extbase individual code on backend-deletion of an object

让人想犯罪 __ 提交于 2019-12-01 09:07:20
I would like to execute some individual code when one of my Extbase domain objects is deleted from the list view in TYPO3 backend. Thought that it could / would work by overwriting the remove( $o ) method in the according repository like public function remove( $object ) { parent::__remove( $object ); do_something_i_want(); } , but that won't work I guess. Looks like the repository-methods are only called / used by actions of my extension (e.g. if I had some delete-action in a FE- or BE-plugin) but not when the object is just deleted from list view in the backend? I don't use (up to now) any