Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [onsaveentry]

The tag has no usage guidance.

1
vote
0answers
11 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){ /...
0
votes
0answers
20 views

EVENT_AFTER_SAVE_ELEMENT fires twice for some weird reason

Any idea why this code is always fired 2 times every time I save my entry? I get the same thing with Elements::EVENT_BEFORE_SAVE_ELEMENT (only for test purposes as I need to trigger AFTER), same thing ...
-1
votes
1answer
24 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 ...
1
vote
1answer
27 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. ...
1
vote
1answer
66 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 ...
2
votes
0answers
43 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 ...
2
votes
2answers
151 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 ...
1
vote
1answer
64 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)...
4
votes
1answer
575 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 ...
2
votes
1answer
538 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 ...
4
votes
3answers
372 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 ...