extbase

TYPO3: Remove validation from ObjectStorage property in model

陌路散爱 提交于 2019-12-22 14:57:08
问题 Does anyone knows if it is possible to remove recursive validation from model in extbase TYPO3? Let's say I have model with following properties: /** * @var string * @validate NotEmpty */ protected $title; /** * @var string * @validate NotEmpty */ protected $city; /** * @lazy * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<my/model/classname> */ protected $categories; When passing my object to controller action I want only title and city to be validated. I would like categories not to be

TYPO3 extbase - fluid variable to jquery

时间秒杀一切 提交于 2019-12-22 11:24:51
问题 How could one pass a fluid variable from the controller to jQuery or JavaScript? Inside my controller: public function tabs () { $this->view->assign('tab', 1); } Inside fluid I'd use the variable as {tab} But how can I pass to JavaScript? Any help would be appreciated... 回答1: JS in fluid templates behaviour is ... terrible in most cases, if your JS code contains any curly brackets you need to include external script instead placing the script in the view. The reason is that Fluid thinks, that

TYPO3 Extbase backend module. Template path issue

牧云@^-^@ 提交于 2019-12-22 10:27:14
问题 I'm experiencing a strange problem with extbase/fluid extension creation. I use TYPO3 6.1 I've made an extension with a backend module on my dev server (same configuration/hardware then the prod). The module works perfectly with the path to the template : myext/Resources/Private/Backend/Templates myext/Resources/Private/Backend/Layouts myext/Resources/Private/Backend/Partials After this, I downloaded my extension's zip in the ext manager and then installer on the prod server. Now I can't use

TYPO3 tutorial extension, controller does not exist

被刻印的时光 ゝ 提交于 2019-12-22 07:10:10
问题 I'm trying to get started with TYPO3 extensions and was following this tutorial to get to see the basics. In the backend everything works fine, but on the front end I get an error: Oops, an error occurred! Code: 20170209104827c3b58d58 - {"exception":"exception 'ReflectionException' with message 'Class Tx_Inventory_Controller_InventoryController does not exist' My files are exactly the same as in the tutorial. I have no idea what is causing this. I assume I made some dumb mistake with

Execute repository functions in scheduler task

本小妞迷上赌 提交于 2019-12-22 05:44:45
问题 Currently I have an scheduler task, but I want to use function from my extbase repository (in the same extension). I keep getting "PHP Fatal error: Call to a member function add() on a non-object", no matter how I try to include my repo or controller from extbase. My SampleTask.php: namespace TYPO3\ExtName\Task; class SampleTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask { public function execute() { $controller = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\TYPO3\ExtName

typo3 extbase: validate a form

我们两清 提交于 2019-12-21 20:39:00
问题 I created a simple "subscribe to newsletter" form: <f:form action="subscribe" method="post" name="newsletterform"> <f:form.textfield id="name" name="name" required="true" /> <f:form.textfield id="email" name="email" required="true"/> <button type="submit">Submit</button> </f:form> as you can see, this is not a form that's based on an existing model, I have no interest in saving newslettersubscriptions to the database (they'll be stored somewhere else anyways). Now in my subscripeAction I want

Set TYPO3 extbase storagePageIds / storagePid to current

烂漫一生 提交于 2019-12-21 19:28:35
问题 I am using the TYPO3 extension feupload, which relies on extbase. This is my first contact with extbase. But the question is about extbase in general. I expect TYPO3 to include the usual "IN (current-page)" pid check by default in queries, unless told otherwise - but in extbase that seems to be different. Or at least in my case, it's not working. In the extension, there is a constants / setup setting, where the storagePid can be set. This works. But we don't want to adapt that parameter

How do I include or autoload external libraries in a TYPO3 Extbase Extension? + Dependecy Injection?

你离开我真会死。 提交于 2019-12-21 05:27:24
问题 I'm developing a TYPO3 4.6 Extension with Extbase 1.4 and im trying to include an external library. The library, in my case the facebook PHP SDK, is under $_EXTKEY/Resources/PHP/facebook-php-sdk/facebook.php . I would like the library to autoload and automatically inject (Dependecy Injection) where I need it. Some comments I found online suggest that one should include libraries with require_once(): http://forge.typo3.org/issues/33142 if it's just a tiny helper library, it's intended to be

Use other than primary key as RealURL id_field

倖福魔咒の 提交于 2019-12-20 07:29:47
问题 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

use removeAll() in scheduler task

孤人 提交于 2019-12-20 04:35:24
问题 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