Questions tagged [saveentry]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
95 views

Programmatically enable an entry for all sites if Enabled in one site

In a multi-sites setup, I have a Channel where Entries are not enabled by default. When a CP user review them, I would like that they are automatically enabled in all sites without having to enable ...
Romain P.'s user avatar
  • 1,798
0 votes
0 answers
58 views

Saving tags via front end entry form - craft cms 4 and selectize.js

I have a front end entry form that allows users to update their entry. I have created a tag field using selectize.js that displays the existing tags for that entry, allows the user to enter their own ...
George Bleasdale's user avatar
1 vote
1 answer
67 views

Saving entry on page visit using craft 'configure' function

I need to send a simple (one-off) survey to users and capture their answer in the most unobstructive way. It's one question with a yes/no answer. Setting up mailchimp(or other service) seems overkill, ...
MetaMachine's user avatar
0 votes
0 answers
202 views

Ajax entry save error 403

I have a front end form submitting via ajax that was working fine. Im now starting to see 403 exception - something craft is now forbidding. There is no error in the response object. I have the ...
joomkit's user avatar
  • 2,004
1 vote
1 answer
219 views

How to save an entry using AJAX on a frontend Form [ for registered users]

I'm having a follow button on the front end it allows you to save an entry to a specific section (type: channel) and it's all working great, but i need to achieve this with AJAX This is my Form {% if ...
Ra3d K's user avatar
  • 125
1 vote
1 answer
50 views

Will having the Craft storage directory (CRAFT_STORAGE_PATH) on a Digital Ocean Volume (like AWS EBS) dramatically affect CMS save performance?

We use the Craft CMS headlessly. We have a deployment with 5 sites and an entry type with a very complicated Matrix field. We are using a Digital Ocean Volume (like AWS EBS) for the Craft storage ...
weotch's user avatar
  • 155
1 vote
1 answer
31 views

Assign category to entry using a plugin

Feel like I'm going crazy here... I've got this snippet of code. I find my entry based on title key/value. I find my category ids based on alcohol key/value. I attempt to set the entry category ...
Sean Delaney's user avatar
2 votes
1 answer
107 views

Retrieving entry just after saving it returns null

I'm having this issue where when I save an Entry and try to fetch right away I get a null. Example: $entry = new Entry([stuff here]); $entry->title = 'foo'; if (!Craft::$app->elements->...
flipjms's user avatar
  • 121
0 votes
0 answers
29 views

Entry list field get duplicated entries from specific section

I have some weird behavior when I have an entry list field (in a super table, but I get the same behavior from the native entry list field type). When I select an entry from a certain section, it will ...
jishi's user avatar
  • 263
1 vote
1 answer
307 views

How to update stock on a product variant? Setting unknown property error

I am trying to update stock of product variants using a custom plugin on our Craft 3 eCommerce site (its a sync process with an external database). But I can't figure out how to update stock, I get an ...
Laurence Cope's user avatar
1 vote
1 answer
147 views

Parent are not set anymore after saveElement()

In this code I try to create a new Entry and set a Parent to it. The sectionId and the typeId are actually the same. $navigationItem = new Entry(); $navigationItem->typeId = 4; $navigationItem->...
Slowwie's user avatar
  • 235
1 vote
1 answer
554 views

Change matrixblock field value before save element

So i have a Matrix with one type of matrixblocks. These all have a field for a custom id which should be set by the system, if empty, before the entry is saved. I can access the individual ...
Leonardo's user avatar
  • 419
2 votes
1 answer
522 views

How to immediately redirect to an entry after creating the new entry from a frontend form?

I'm using a frontend form to create an entry with {{ actionInput('entries/save-entry') }} and would like to be able to use this entry immediately upon redirecting from the submit. From the docs I see ...
Brimby's user avatar
  • 333
2 votes
1 answer
451 views

How can I set a Neo field's values from my plugin/module?

I wish to programmatically set the value of a Neo field. This is my current approach: $entryData = self::setupEntryData($item); $entry = new Entry($entryData); $fieldValues = [ 'heading' => $...
Danail Emandiev's user avatar
0 votes
1 answer
156 views

Making changes to existing page - how do I make a draft page first?

I'm making extensive updates to our homepage. Before I dig in, I want to confirm the steps to create a draft without overwriting the existing page. Select the entry that requires changes Select "...
Kara's user avatar
  • 3
1 vote
1 answer
231 views

Update entry Enabled value based on field value when saving

I am trying to update the value of the entry enabled field depending on a certain field value. I am listening to the EVENT_BEFORE_SAVE event and have it updating as such $entry->enabled = $status =...
zizther's user avatar
  • 449
2 votes
3 answers
924 views

How to create a new Entry model in Craft 3?

I want to create a new entry for a section named 'drinks'(having section id= 6). The namespace of the file having this code is namespace putyourlightson\userguide\controllers;.I copied this code from ...
jamesSeb's user avatar
1 vote
1 answer
566 views

Bad Request: Post Request Required when saving hyperlink in specific redactor field

I'm having a strange issue here. I have a site running Craft 3.3.7. I have an entry with a matrix field with several redactor fields in it. In one of those redactor fields, I have a paragraph of text. ...
Josh Parylak's user avatar
1 vote
1 answer
2k views

Redirect after saving an entry

The question was already asked (Possible to redirect elsewhere after saving an entry?) but this was about Craft 2.x. Up until now I used the following code in my plugin (I took it from one of the ...
anvar's user avatar
  • 67
2 votes
1 answer
150 views

Update a lightswitch field in Craft CMS 2

How can I edit a lightswitch field in an entries field layout via PHP? This is my current approach public function actionSponsoredEntriesPriority() { $this->requireAdmin(); $this->...
inrsaurabh's user avatar
4 votes
1 answer
3k views

Craft 3 - Save new Entry with Relations (Categories/Assets)

i simply can not get my "job" done. I try to create a plugin for Craft, a simple one. It reads some date and should create new entries out of this data. First i stuck on a stupid save-mistake, someone ...
Thomas's user avatar
  • 85
0 votes
1 answer
221 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
86 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
565 views

How do I change the value of a select box field of a certain entry through the front-end?

So I'm having this entry (a product) that contains a selectbox field with two values: Reserved Available By default this field is set to 'Available', but when the user lands on a certain page (a ...
mdmngz's user avatar
  • 157
1 vote
1 answer
177 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
1 vote
1 answer
80 views

Posting children to a Structure

This question is a follow up of a previous question see: (Entry Form - Multiple Entries & Entry Type & Parent) I am trying to add multiple children to a pre-existing multi level structure: ...
Graham Winston's user avatar
0 votes
0 answers
96 views

Editing expired entries from the front end

I'm trying to edit an expired entry from the front end. However, when I hit save, none of the changes persist and a redirect doesn't take place. Entries that have a live status are fine. Even when I ...
Steven Grant's user avatar
  • 1,855
1 vote
1 answer
158 views

How to save multiple related entries on the frontend with 1 checkbox?

I have a frontend form and would like to save multiple related entries by checking 1 checkbox. I have this working to save 1 related entry: <input type="checkbox" id="user-type-select-{{ userType|...
Tom De Smet's user avatar
  • 1,456
1 vote
2 answers
797 views

Craft entries won't save (new or edits)

So I am trying to create a new entry, but every time I click save, nothing is actually saved. (see gif) THINGS I HAVE TRIED: Overwriting the app folder with a freshly downloaded one (I am already ...
stojda's user avatar
  • 163
1 vote
1 answer
3k views

How to save a new entry with custom fields - Craft 3

I'm trying to create a new Entry via PHP, with custom fields (Craft 3). I can save it, however my custom fields don't appear. I've tried using setFieldValue, as well as $entry->excerpt = 'Lorem...';...
SteveEdson's user avatar
1 vote
1 answer
38 views

Single type for entry submission on error loses entry object

I have created a contact form inside a single entry type 'contact' for front end submissions. This lets me display editing options for title and body and display the form. When submitting the form, ...
joomkit's user avatar
  • 2,004
2 votes
1 answer
329 views

Can entries be disabled by default for 2/3 of the languages on my website

I have a 3 language website that I made for a client. The website is in Dutch, Japanese and English. When my clients creates a new entry, most of the time they want to have the Japanese and English ...
Branko's user avatar
  • 495
1 vote
1 answer
151 views

How to submit custom fields that are added in the right pane to your plugin?

I'm making my first Craft plugin. I have added custom fields to the right of an entry form with the cp.entries.edit.right-pane hook ("Share on.."). But I can't seem to find how to 'transfer' these ...
Thaoms's user avatar
  • 93
1 vote
1 answer
135 views

Entry should not activated by default

Would it be possible that when you create a new entry, it's not activated by default? I know there is a "Draft" option... But is there an option for this? Best, Marcel
Mvrcel Boer's user avatar
1 vote
1 answer
69 views

Built in validate of title when using EntryModel?

The example below will continue to save entries with the same title and slug. Is there a built in validation when using craft()->entries->saveEntry? $entry = new EntryModel(); $entry->...
Adam McCombs's user avatar
  • 1,695
1 vote
1 answer
110 views

Entry not saving when date isn't changed using frontend form

When editing an entry (actually it's a product within Craft Commerce but everything seems the same) with a pre-existing date, the field looks like this: <input name="fields[date][date]" value="06/...
Clive Portman's user avatar
3 votes
2 answers
1k views

Update form entry using the Guest Entries plugin

I am trying to create a form that anyone can submit regardless if they are logged in or not. I found the Pixel & Tonic Guest Entries plugin for this. Now that I've installed and configured the ...
Branko's user avatar
  • 495
1 vote
1 answer
599 views

Problem saving new entry populated with setContentFromPost() while setContent() works

I'm building a cinema program, and I'm trying to build entries for movies and shows loading external data via a plugin. I'm getting close, but now I've hit a roadblock trying to save the entries. I ...
KSP's user avatar
  • 849
0 votes
1 answer
386 views

How to handle entry save in plugin when entryId is not set?

Referring to my older question, I have the entryId working on an existing entry. However I've noticed a new entry doesn't have an entryId set (makes sense). I have some custom information in text ...
iNalgiev's user avatar
0 votes
1 answer
85 views

Craft\Exception on saving entries having images

I have created a new entry in which user can also add images(already uploaded or new upload) I can save entry successfully if I don't add any images to it. When I add any image and try to save the ...
Amey Dahale's user avatar
2 votes
1 answer
219 views

Entry slug auto appends -1 even when the original slug is unique

I have an entry slug like this: cics-west-belden-1 the -1 seems to be auto appended to the slug, but there are no other entries with the project cics-west-belden in my project. When I remove the -1 ...
ChaiTea's user avatar
  • 95
1 vote
1 answer
814 views

Entry Form: redirect not working

I use a front-end entry form based on the official documentation (https://craftcms.com/docs/templating/entry-form), but after saving the entry, I am running in an error 404 on the entry page. <...
MISC's user avatar
  • 1,019
2 votes
1 answer
155 views

Checking for first time an entry is "published" i.e. saved with a Live status

Is there a way, via an Event or otherwise, to catch the first time a post is saved and isn't in disabled mode? I want to send out an email alert to users when a new entry is published, but I want it ...
John O's user avatar
  • 391
1 vote
1 answer
1k views

How to handle multiple users simultaneously editing an entry?

If 2 or more people are editing a entry at the same time in Craft, the last person to save the entry overrides everyone else's work. It doesn't seem any diffing is involved to resolve this. I'm using ...
Anthony Cossins's user avatar
2 votes
2 answers
93 views

Losing focuspoint on saveEntry by plugin

I've implemented a plugin for synchronizing an external Database into my Craft project which also includes images. Those images have a focuspointer but i lose the focuspointer onSaveEntry by my ...
Marco Schuler's user avatar
2 votes
1 answer
715 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
2 votes
1 answer
508 views

Can't rename slug

Each time I try to rename a slug within an entry, the page refreshes, but the slug is getting a -1 appended. The slug I want is: forms. The slug I get after saving is: forms-1. I've checked through ...
Matt Ellis's user avatar
1 vote
1 answer
76 views

Model validation not run when using EntriesService saveEntry method

Currently i have to validate my model before saving because of some custom validation rules setted on the model which won't run when using the EntriesService saveEntry method. This causes a two step ...
Jacob's user avatar
  • 282
0 votes
1 answer
307 views

<form><matrixBlock><checkbox></matrixBlock></form> How do I store multiple form entries in 1 table field?

A tricky one. I have a form which sits on a section entry template. When user submits form from one page of the template, it saves the entries into the table. BUT user going to another page of the ...
Rich Holt's user avatar
2 votes
3 answers
235 views

Entry validation not working when Publish live changes permission is not checked

when a user with no permission to publish is submitting a blank entry, the entry is saved anyway without any errors. Here is the permissions set to the user group: I have few required field as ...
pvledoux's user avatar
  • 133