|
|||||||
| Registrieren | Hilfe | Benutzerliste | Kalender | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren |
|
#1
|
|||
|
|||
|
Hello all,
because I just don't know where and what to search for: What hook (or similar) can I use, if I want to verify/modify data entered into a content elements BE-Form before it is saved? Detailed example: If the user uploads a file as part of the content element I want to fill the file size of that file into a db field automatically instead of letting the user enter the data. But how to hook in? And as add on: How do I define which data of a content element is shown in the summary when WEB/PAGE is selected, i.e. in the list of content elements in column normal? Thanx in advance, -- br Matthias _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#2
|
|||
|
|||
|
Hi!
Matthias Stuebner wrote: > What hook (or similar) can I use, if I want to verify/modify data entered > into a content elements BE-Form before it is saved? You need to search in t3lib/class.tcemain.php. Look in function named process_datamap(). You will find at least three hooks there. All of them accept parameters from record array. But examine the functin carefully because parameters may have unexpected values to you (like negative pid, which is not a pid but a pointer to another content element, etc). -- Dmitry Dulepov TYPO3 freelancer / TYPO3 core team member Web: http://typo3bloke.net/ Skype: callto:liels_bugs _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#3
|
|||
|
|||
|
On Wed, 06 Jun 2007 09:50:02 +0300, Dmitry Dulepov wrote:
> You need to search in t3lib/class.tcemain.php. Look in function named > process_datamap(). You will find at least three hooks there. All of them > accept parameters from record array. But examine the functin carefully > because parameters may have unexpected values to you (like negative pid, > which is not a pid but a pointer to another content element, etc). Thanx for that great pointer, somehow I think I begin to understand something more.... -- br Matthias _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#4
|
|||
|
|||
|
On Wed, 06 Jun 2007 09:50:02 +0300, Dmitry Dulepov wrote:
> You need to search in t3lib/class.tcemain.php. Look in function named > process_datamap() One add-on: Setting a hook works fine up to the point where I discovered that the return of the hook function isn't used by the caller at all. I want to modify/set the value of a field that then should be shown in the form as it would have been entered, but when I set $incomingFieldArray['field'] in my function, the process_datamap() doesn't care. Is there a way to modify $incomingFieldArray in the way I would like? -- br Matthias _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#5
|
|||
|
|||
|
On Thu, 7 Jun 2007 15:46:25 +0200, Matthias Stuebner wrote:
> Is there a way to modify $incomingFieldArray in the way I would like? Maybe important: More detailed the thing I miss is that the data I set (and which can be verified even in the post-Hook doesn't get shown in the form. How can I achive this? -- br Matthias _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#6
|
|||
|
|||
|
On Thu, 2007-06-07 at 15:58 +0200, Matthias Stuebner wrote:
> On Thu, 7 Jun 2007 15:46:25 +0200, Matthias Stuebner wrote: > > > Is there a way to modify $incomingFieldArray in the way I would like? > > Maybe important: More detailed the thing I miss is that the data I set (and > which can be verified even in the post-Hook doesn't get shown in the form. > How can I achive this? i use processDatamap_afterDatabaseOperations hook and in my function i reference the variables : processDatamap_postProcessFieldArray ($status, $table, $id, & $fieldArray, &$pObj) this way i can modify and add data to the field array, since i reference the pObj variable, i use it to return warning and errors to the editor hope this helps, Serge _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#7
|
|||
|
|||
|
On Thu, 2007-06-07 at 16:42 +0200, serge vleugels wrote:
> On Thu, 2007-06-07 at 15:58 +0200, Matthias Stuebner wrote: > > On Thu, 7 Jun 2007 15:46:25 +0200, Matthias Stuebner wrote: > > > > > Is there a way to modify $incomingFieldArray in the way I would like? > > > > Maybe important: More detailed the thing I miss is that the data I set (and > > which can be verified even in the post-Hook doesn't get shown in the form. > > How can I achive this? > > i use processDatamap_afterDatabaseOperations hook > and in my function i reference the variables : > processDatamap_postProcessFieldArray ($status, $table, $id, & > $fieldArray, &$pObj) > > this way i can modify and add data to the field array, since i reference > the pObj variable, i use it to return warning and errors to the editor > > hope this helps, > > Serge > Oh yes, If you want data stored in fields not editable by the user, define them in the tca, but do not put them in the types array, i have used it this way and works like a charm, or better, put them in the types array, but dont give none admins access (using "exclude" => 1 in the tca) _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#8
|
|||
|
|||
|
On Thu, 07 Jun 2007 16:47:50 +0200, serge vleugels wrote:
> If you want data stored in fields not editable by the user, define them > in the tca, but do not put them in the types array, i have used it this > way and works like a charm, or better, put them in the types array, but > dont give none admins access (using "exclude" => 1 in the tca) The thing I struggle with is, that as soon as I set the type in TCA = "none" to make it read-only the datafield seems not to be processed by that hook anymore. I tested it several times and could reproduce it. So setting it to admin only might give the same result, but I would call it a hack only. Anyway, thanx for your help. -- br Matthias _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | Thema bewerten |
|
|
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| [TYPO3-templavoila] Data structure selector content missing inflexible content element | Hans van Dijk | typo3-project-templavoila@lists.netfielders.de | 5 | 06.06.2007 08:44 |
| [TYPO3-dev] new content element in new table? | Thomas Mammitzsch | typo3-dev@lists.netfielders.de | 5 | 14.05.2007 20:12 |
| [TYPO3-dev] Hook for additional content-related information | Tapio Markula | typo3-dev@lists.netfielders.de | 0 | 25.04.2007 16:58 |
| [TYPO3] Error when saving content with users that lacks adminrights? | Oscar Winter | typo3-english@lists.netfielders.de | 0 | 09.02.2007 22:59 |
| [TYPO3] assign a content element to the end of a content area | Jamie Lawrence Jenner | typo3-english@lists.netfielders.de | 4 | 30.01.2007 17:02 |