Questions tagged [saveentry]
The saveentry tag has no usage guidance.
52
questions
0
votes
0
answers
43
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 ...
1
vote
1
answer
30
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 ...
1
vote
1
answer
30
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 ...
1
vote
1
answer
16
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 ...
2
votes
1
answer
68
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->...
0
votes
0
answers
26
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 ...
1
vote
1
answer
166
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 ...
1
vote
1
answer
93
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->...
1
vote
1
answer
358
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 ...
1
vote
1
answer
257
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 ...
1
vote
1
answer
206
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' => $...
0
votes
1
answer
74
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 "...
1
vote
1
answer
183
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 =...
2
votes
3
answers
512
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 ...
1
vote
1
answer
422
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. ...
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 ...
2
votes
1
answer
111
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->...
4
votes
1
answer
2k
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 ...
0
votes
1
answer
183
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
1
answer
76
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
1
answer
448
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 ...
1
vote
1
answer
158
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 ...
1
vote
1
answer
71
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:
...
0
votes
0
answers
81
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 ...
1
vote
1
answer
125
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|...
1
vote
2
answers
648
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 ...
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...';...
1
vote
1
answer
37
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, ...
2
votes
1
answer
306
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 ...
1
vote
1
answer
134
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 ...
1
vote
1
answer
128
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
1
vote
1
answer
66
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->...
1
vote
1
answer
101
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/...
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 ...
1
vote
1
answer
590
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 ...
0
votes
1
answer
379
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 ...
0
votes
1
answer
74
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 ...
2
votes
1
answer
217
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 ...
1
vote
1
answer
762
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.
<...
2
votes
1
answer
142
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 ...
1
vote
1
answer
873
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 ...
2
votes
2
answers
92
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 ...
2
votes
1
answer
708
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 ...
2
votes
1
answer
477
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 ...
1
vote
1
answer
75
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 ...
0
votes
1
answer
298
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 ...
2
votes
3
answers
225
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 ...
4
votes
1
answer
771
views
How to use select dropdown with entries/saveEntry for an entry field?
How to use select dropdown with entries/saveEntry for an entry field?
I have an entry with a field that is another entry, which I want to update with a form:
<form method="post" accept-charset="...
0
votes
1
answer
721
views
Foreign key constraint sql error from entries/saveEntry when adding entry
I am getting a foreign key constraint sql error when trying to add an entry through a front end form.
<form method="post" accept-charset="UTF-8">
{{ getCsrfInput() }}
<input type="hidden"...
0
votes
1
answer
71
views
onBeforeSaveEntry is hanging on import
I am using the Import plugin. This question doesn't have to do with the Import plugin which seems to be working swell, but instead with my onBeforeSaveEntry logic which seems to have botched the ...