Questions tagged [saveentry]

The tag has no usage guidance.

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

Problem with entry relations in using craft + postgres

I have a custom module saving entries into the system and those entries contains several category relationships. I have done the same previously with MySql and never had problems. I am currently ...
1
vote
1answer
26 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->...
0
votes
1answer
46 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 ...
0
votes
0answers
13 views

Creating an entry with a hidden title from a frontend form is failing

I have the Title Format set to {id} and that works fine if I create an entry manually from the CP. But I'm trying to create the entry from a frontend form, and it's erroring on me whether I try to ...
1
vote
1answer
35 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
1answer
32 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
1answer
31 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
1answer
74 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 =...
1
vote
3answers
93 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
1answer
196 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
1answer
942 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
1answer
66 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->...
2
votes
1answer
1k 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
1answer
146 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
51 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
209 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
1answer
134 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
1answer
58 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
0answers
67 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
1answer
85 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
2answers
469 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
1answer
2k 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
1answer
35 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
1answer
263 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
1answer
124 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
1answer
103 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
1answer
63 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
1answer
81 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
2answers
865 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
1answer
557 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
1answer
357 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
1answer
67 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
1answer
179 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
1answer
689 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
1answer
125 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
1answer
721 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
2answers
89 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
1answer
680 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
1answer
308 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
1answer
74 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
1answer
294 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
3answers
194 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
1answer
667 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
1answer
602 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
1answer
63 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 ...
2
votes
1answer
382 views

Assign entry id to title with entry form

I have an entry form to take user generated content. The section it passes the info to has a customised title format Submission ID: {id} However, when the entry gets submitted, the title in the CP (...
1
vote
1answer
184 views

saveEntry() not firing

I'm using code I've been using to update existing entries for a while now and it's failing to fire following the 2.5 upgrade. Trying to figure out what might have changed, or if there's something I'm ...