Feature: The profile update event carries the site and the origin
Description
\FGTCLB\ carries two more
values next to the profile:
getreturns the site the profile belongs to, when the dispatcher knows it, andSite () nullotherwise. A backend save passes the site of the profile's page and a frontend edit the site of its request; the commands pass none.getreturns where the update came from, as a case of the new enumOrigin () \FGTCLB\:Academic Persons\ Event\ Profile Update Origin CreationandSynchronizationfor the frontend user commands,FrontendforEditing EXT:,academic_ persons_ edit Backendfor a DataHandler save,Importfor a DataHandler run marked as an import, andUnknownfor a dispatcher that passes nothing.
Both are optional constructor arguments, so
new After stays valid and yields no site and
the origin Unknown. The case set of the enum is fixed; a listener may
match
over it exhaustively.
Import code that writes profiles through the DataHandler marks its run with
the new enum
\FGTCLB\,
after
start, which replaces the correlation id:
$dataHandler->start($datamap, []);
$dataHandler->setCorrelationId(ProfileWriteCorrelation::Import->create());
$dataHandler->process_datamap();
Its saves are then announced with the origin Import instead of
Backend, see Important: Backend saves announce profile updates.
Profile marks a run that is never announced;
a listener of the event that writes profiles through the DataHandler uses it
for its own runs.
Impact
Listeners can tell a backend save from an import and from a frontend edit,
and defer or skip work for some of them. The translation synchronisation of
EXT: takes the site from the event. Only for an event
without one does it fall back to the site of the global request and then of
the profile's page - except for a backend save or an import, which carry no
site only when the profile's page belongs to none, and are then not
synchronised.