Skip to main content

Questions tagged [onsaveentry]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
3 answers
2k views

How to change an entry's slug on EVENT_AFTER_SAVE_ELEMENT?

My entries' titles are auto-generated from several fields values on first save. When one of these fields values change, I would like to update the auto-generated slug also: Event::on( \craft\...
Romain P.'s user avatar
  • 1,852
1 vote
0 answers
156 views

Can't set structured entry parentId in BEFORE_SAVE event using field data

I have created an event that is called on beforeSave within my plugin. Code below: Event::on( Entry::class, Entry::EVENT_BEFORE_SAVE, function(ModelEvent $event){ /...
Dean Sanderson's user avatar
0 votes
1 answer
232 views

Entry not saving when Redactor bold

I'm having a weird issue with the Rich Text Editor (Redactor -> simple.json, only "bold" and "italic") on newly added fields and only ONE (that i know of) older field. Every time i add a "bold" format ...
Cryptomothy's user avatar
1 vote
1 answer
98 views

Allow registered end-user to update entry, but limited only to specific fields (Craft 3)

I want to allow end-users (registered as users in Craft) to update only specific fields of an entry. I know that only those fields included in the form are being updated; but this isn't secure enough. ...
Mischa Sz.'s user avatar
1 vote
1 answer
181 views

Radio buttons in matrix field not saving

Craft CMS version 3.0.9 (updated from 3.0.1 to try and fix). I have a layout field in a matrix box with the radio buttons field type with the options normal (default), full, left, right. When saving ...
sput's user avatar
  • 31
2 votes
0 answers
308 views

Bulk resave user entries to trigger onSaveEntry event

Is it possible to bulk save user entries to force an onSaveEntry event. I added a new custom preparse field to Users, but need to trigger a save event to propagate. Regular sections can reindex by ...
Shanan Galligan's user avatar
3 votes
2 answers
428 views

Modifying entry with 'onBeforeSaveEntry' event

I'm trying to modify a field on an entry before it is saved. What I'm trying to do is use a field from a linked entry to populate the same field on the entry being saved. From logging I know the ...
mrsmn's user avatar
  • 731
1 vote
1 answer
74 views

Changing asset of entry's assetfield via entries.onBeforeSaveEntry

I'm trying to add an asset to an entry's assetfield when the entry is saved by using the onBeforeSaveEntry service provided by Craft. craft()->on('entries.onBeforeSaveEntry', function(Event $event)...
justussimon91's user avatar
5 votes
2 answers
2k views

Bulk resave entries to trigger onSaveEntry event

I have a site with a hundred+ or so entries. I've added a new field to my entry template, but it won't take effect until it's been activated by a onSaveEntry event. I've gone through maybe 15 ...
Rob Erskine's user avatar
2 votes
1 answer
719 views

Craft\EntryModel and its behaviors do not have a method or closure named "ui"

I'm getting this error when saving a post which has a Matrix field. Craft\EntryModel and its behaviors do not have a method or closure named "ui". I have ran a search in my templates and don't have ...
willhibberd's user avatar
3 votes
3 answers
875 views

Updating the postDate field from a plugin?

I think I'm almost there with this one but obviously missing something as the postDate is not updating. I have the following in an onSaveEntry event. It's saying it's successful but the postDate does ...
Lettie's user avatar
  • 2,033