I made several tests on this issue. What I can say is that for me in latest v10 and latest v9 the records array contains the correct record uid as soon as the record is persisted.
Only on newly unsafed records there is no uid just the NEW... string which won't help really much for fetching relations IMO.
Here is some output of my tests with v10:
One creates a new record and DOESN'T FILL a generator field. Than clicks save (saving the record).
Output: No uid in records array
generator function call: DataHandler::checkValueForSlug (Line:1852)
$value = $helper->generate($fullRecord, $realPid, $id);
One creates a new record and FILLS OUT a generator field. Than clicks save (saving the record).
Output: No uid in records array
generator function call: DataHandler::checkValueForSlug (Line:1852)
$value = $helper->generate($fullRecord, $realPid, $id);
One creates a new record and DOESN'T FILL a generator field. Than clicks on the "suggest" button of the slug element.
Output: No uid in records array
generator function call: FormSlugAjaxController::suggestAction (Line:99)
elseif ($mode === 'recreate') {
$proposal = $slug->generate($recordData, $parentPageId, $recordId);
}
One creates a new record and FILLS OUT a generator field. Than clicks on the "suggest" button of the slug element.
Output: No uid in records array
generator function call: FormSlugAjaxController::suggestAction (Line:99)
elseif ($mode === 'recreate') {
$proposal = $slug->generate($recordData, $parentPageId, $recordId);
}
One has already persisted a record, removes the slug manually and than clicks save (saving the record).
Output: Uid is present in records array
generator function call: DataHandler::checkValueForSlug (Line:1852)
$value = $helper->generate($fullRecord, $realPid, $id);
One has already persisted a record and than clicks on the "suggest" button of the slug element.
Output: Uid is present in records array
generator function call: FormSlugAjaxController::suggestAction (Line:99)
in /var/www/html/typo3/sysext/backend/Classes/Controller/FormSlugAjaxController.php line 99
elseif ($mode === 'recreate') {
$proposal = $slug->generate($recordData, $parentPageId, $recordId);
}
One has already persisted a record, changes a generator fields value and than clicks on the "suggest" button of the slug element.
Output: Uid is present in records array
generator function call:FormSlugAjaxController::suggestAction (Line:99)
elseif ($mode === 'recreate') {
$proposal = $slug->generate($recordData, $parentPageId, $recordId);
}
I don't think we should extend the hook just to provide the NEW... string. What do you think?