Skip to content

Fix order of arguments for onContentBeforeSave event#173

Merged
parapente merged 4 commits intojmcameron:masterfrom
DSE-Western-Thessaloniki:parapente/issue171
Jan 5, 2026
Merged

Fix order of arguments for onContentBeforeSave event#173
parapente merged 4 commits intojmcameron:masterfrom
DSE-Western-Thessaloniki:parapente/issue171

Conversation

@parapente
Copy link
Copy Markdown
Collaborator

Fixes #171

@JLTRY
Copy link
Copy Markdown
Collaborator

JLTRY commented Jan 2, 2026

Seems good to me https://manual.joomla.org/docs/5.4/building-extensions/plugins/plugin-events/content/#oncontentbeforesave
I can not reproduce as none of my plugins use this event

@parapente
Copy link
Copy Markdown
Collaborator Author

parapente commented Jan 2, 2026

Note that both item and data show the data which is going to be saved, in other words, the modified data. Neither shows the data values which are currently in the database.

Hmmm... Maybe I should not add null as the $data argument and use $model as its value. Unfortunately I don't have any plugin that will use this event and the $data argument. This event was added to achieve indexing of the attachments. The finder plugin uses only the first two arguments of the event. I will update the PR later this day.

@parapente
Copy link
Copy Markdown
Collaborator Author

For some reason moving the event triggering breaks attachments on newly created articles. This PR is not ready for merge yet.

@parapente
Copy link
Copy Markdown
Collaborator Author

This should work just fine now. Please test

@JLTRY
Copy link
Copy Markdown
Collaborator

JLTRY commented Jan 5, 2026

I propose to merge

@parapente parapente merged commit 4ab0ec5 into jmcameron:master Jan 5, 2026
@parapente parapente deleted the parapente/issue171 branch January 5, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants