Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: data-publisher-ignored no effect

Status Resolved
Add-on / Version Publisher 2.6.3
Severity
EE Version 3.5.10

Mohammed Al-Faisal

Oct 10, 2017

Hi Brian,

Thanks for all the great work.

I have a form that allows guests to add entries to a channel (feedback), it uses the default EE form exp:channel:form with data-publisher-ignored=“yes”. The form functions properly in the default language however when viewed in another language the language prefix is still added to the form action and other fields.
Any ideas?

Form tag:

{exp:channel:form channel="feedback" class="feedback" id="feedback" error_handling="inline" json="yes" rules:feedback_radio="required" data-publisher-ignored="yes"}

Output for second language (en):

<form id="feedback" class="feedback" method="post" action="http://example.com/en/page" enctype="multipart/form-data" data-publisher-updated="true">
#1

BoldMinded (Brian)

Can you be more descriptive in the actual error you’re getting? Are you saving the form and getting an error message? If so what is the message? Is it submitting but just not saving content changes?

The ignored property is only necessary for when you need to post to external sites so Publisher doesn’t append a prefix to a different domain name that isn’t your site.

#2

Mohammed Al-Faisal

I get this EE error after submitting the form in the second language:

Exception Caught

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘) ) LIMIT 18446744073709551615’ at line 6: SELECT Category_categories.cat_id as Category__cat_id, Category_categories.site_id as Category__site_id, Category_categories.group_id as Category__group_id, Category_categories.parent_id as Category__parent_id, Category_categories.cat_name as Category__cat_name, Category_categories.cat_url_title as Category__cat_url_title, Category_categories.cat_description as Category__cat_description, Category_categories.cat_image as Category__cat_image, Category_categories.cat_order as Category__cat_order, Category_category_field_data.cat_id as Category__cat_id, Category_category_field_data.site_id as Category__site_id, Category_category_field_data.group_id as Category__group_id, Category_category_field_data.cat_id as Category__cat_id, Category_category_field_data.site_id as Category__site_id, Category_category_field_data.group_id as Category__group_id FROM (exp_categories as Category_categories, exp_category_field_data as Category_category_field_data) WHERE Category_category_field_data.cat_id = Category_categories.cat_id AND ( Category_category_field_data.site_id = 1 AND binary Category_category_field_data.cat_id IN () ) LIMIT 18446744073709551615

ee/legacy/database/drivers/mysqli/mysqli_connection.php:122

#3

Mohammed Al-Faisal

Submitting with Ajax gets “Failed to load resource: the server responded with a status of 500 (Internal Server Error)” in the console

#4

BoldMinded (Brian)

Can you be more descriptive… are you submitting the form inside of EE’s admin to save a new or existing entry? Or are you using channel:form to create a new or save an existing entry on the front-end? If so, can you share your channel:form tag markup? Also are you actually trying to save categories or are you getting the error because your form has no category fields in it?

#5

Mohammed Al-Faisal

As mentioned above it uses the default EE form exp:channel:form on the front end to create new entries. The channel tag looks like this:

exp:channel:form channel="feedback" class="feedback" id="feedback" include_jquery="no" json="yes"
    <h3>{phrase:fb_question}</h3>
    <input type="hidden" name="title" value="{embed:title}_{current_time}">
    <input type="hidden" name="url_title" value="fb_{current_time}">

    <input name="feedback_radio" type="radio" value="yes">
    <label for="feedback_radio">{phrase:fb_yes}</label>
    <input name="feedback_radio" type="radio" value="no">
    <label for="feedback_radio">{phrase:fb_no}</label>
    <label for="feedback_text">{phrase:fb_response}</label>
    <textarea name="feedback_text"></textarea>
    <input type="submit" value="{phrase:request_send}" class="disabled" disabled="disabled">
/exp:channel:form

The form doesn’t save categories as I don’t use categories anywhere in this project.

#6

BoldMinded (Brian)

I’m unable to replicate this error. I saved an entry to a channel that does not have any assigned category groups or categories without issue using the channel:form tag. Can you try adding a category group and some categories to your site but don’t assign the group to the feedback channel, then try to re-save an entry. Also try replicating it on my demo.boldminded.com site.

#7

Mohammed Al-Faisal

I added a category group and a couple of fields and didn’t assign to feedback channel and still got the same error.

On demo.boldminded.com I tried to recreate the issue: Created feedback channel with two fields (title, body) and created a channel:form in a template (used cards/index), the form saves correctly on en and de pages.

Still can’t figure out why I’m getting the error on my site? I can send you the server info for my dev install if you would like. It might also help with the issue I posted on https://boldminded.com/support/ticket/1578 It might be worth mentioning that my project started on EE 2 with Publisher 1 and was updated to EE 3 and Publisher 2 when Publisher 2 was released.

#8

Mohammed Al-Faisal

I believe I found the culprit: I have an exp:search:simple_form (main site search form) in the header of every page, when I delete it the feedback form submits properly in the second language. The question now is why is the exp:search:simple_form only interfering when submitting feedback form (or any other exp:channel:form) in the non default language?

#9

BoldMinded (Brian)

The two forms should never conflict, and I don’t see how they could unless the first form does not have a closing /form tag and inadvertently wraps the other. Its going to be a couple days before I can find time to try to replicate this.

#10

BoldMinded (Brian)

Mohammed, I tried to replicate this locally and at http://demo.boldminded.com/forms/entry-edit/5. You can login to that demo site (info is on the home page) to try to replicate the issue.

#11

Mohammed Al-Faisal

Created a demo at http://demo.boldminded.com/de/cards/index . The page has three elements: 1. exp:publisher:languages language switcher. 2. exp:search:simple_form Site search. 3. exp:channel:form form to create new entries. On this demo you’ll get the same SQLSTATE[42000]: Syntax error I’m getting on my site.

#12

BoldMinded (Brian)

Thanks. I was able to replicate this locally, but the strange thing is not a single Publisher function is called before the error. The entire stack trace is EE files only, no 3rd party add-on files. I’ll keep digging into this.

#13

BoldMinded (Brian)

I’ve figured out why the error is happening, but I don’t know what the fix is yet.

#14

BoldMinded (Brian)

The link in the next comment contains a build that should fix the issue.

#15

BoldMinded (Brian)

Comment has been marked private.

#16

Mohammed Al-Faisal

Thanks Brian, installed the build and it solved the issue. Much appreciated and great work.

Login to reply