3

I have added a custom field to my channel field group and selected the "P&T Dropdown" type but whenever I attempt to submit content the edit page just reloads and the database does not get updated.

If I change the value directly within the database then the correct value is selected when the edit page is loaded. But it is still not possible to change the value of the field.

I have tried the following but it is still not possible to post or edit posts to the "damaged" channel:

  1. Backed up database
  2. Uninstalled P&T field types and extension
  3. Removed physical files from server directory
  4. Removed all custom fields from custom field group
  5. Removed association with statuses and categories

This means that I cannot post content to my channel despite the fact that it contains no custom fields, statuses or categories.

I then:

  1. Restored my database
  2. Created a new channel and associated it with the same custom field group, statuses and categories.
  3. Attempted to add content to that channel

That channel works fine, so the problem is with the original channel itself :S

Any ideas?

8
  • Can you check that you're not getting any javascript errors in your browser console on the publish/edit page?
    – Tyssen
    Dec 14, 2012 at 4:58
  • @Tyssen I can confirm that there are no errors in the console window.
    – Lea Hayes
    Dec 14, 2012 at 4:59
  • @Tyssen I can also confirm using the debug facility in EE that the correct data is being sent in the form.
    – Lea Hayes
    Dec 14, 2012 at 5:01
  • Can you try reducing your options down to ones without spaces, dashes or underscores to test if the problem might be there?
    – Tyssen
    Dec 14, 2012 at 5:02
  • @Tyssen Didn't help. I tried reducing the number of options to just 2 as well and that didn't help.
    – Lea Hayes
    Dec 14, 2012 at 5:08

1 Answer 1

5

I have found the source of the error and I believe it to be a bug with ExpressionEngine. I will explain this to the best of my abilities, please feel free to improve the readability of my answer if necessary.

The following is important:

  • Custom channel.
  • Custom field group.
  • Custom field layout for "Edit Content" control panel page.
  • I had a custom field that was using the built-in "Radio" field type.

I then installed the P&T alternative fields and switched from "Radio" to "P&T Radio". When I went to the edit screen I amended the arrangement of fields for easier input. From this point I was not able to create new content in my channel nor edit existing content.

How I diagnosed this:

  • I looked into the "content_publish.php" script because the name content_publish appeared within the URL: admin.php?S=0&D=cp&C=content_publish&M=entry_form&channel_id=2
  • I found the method entry_form and stuck lots of echo lines in there to see what was going on. It seemed that the form was failing validation tests.
  • I then removed all of the custom fields from my custom field group and performed the same action. Again the form was still failing validation (but with no useful errors, and there is a reason for this which I found shortly later).
  • I examined the HTML of the edit page itself and after about an hour of pulling my hair out I realised that the form still contained all of the fields that I had deleted. So I reset my custom field layout via the expandable toolbar and all of the fields amazingly reappeared (even though they don't exist anymore!)

The Problem:

When custom fields are removed or changed the custom layout data is not automatically updated. However, the custom layout data is being used to prepare the form and because the data is inaccurate (contains fields that have been removed, and is invalid where field types have been changed) the form never validates.

But because the fields are not defined any more it was not possible for EE to deliver meaningful validation messages. Though some sort of error message would have been useful :/

The Solution:

I restored my database back to its "broken" state and then:

  1. Navigated to the "Edit Content" page.
  2. Expanded the tool bar and clicked "Reset Layout".

Resetting the layout worked this time because I hadn't removed any fields.

Now I have to reconfigure that layout AGAIN! and I suspect that it will break again in the future for the exact same reasons.

4
  • Epic issue and troubleshooting! This is a very important bug find. Will you report it? Congrats on tracking that down. I read the question and researched for a bit but had absolutely no idea who to help. It's not anything I've seen before.
    – Anna_MediaGirl
    Dec 14, 2012 at 8:13
  • 1
    @MediaGirl Yes I will be reporting this bug. Tbh I really didn't think I'd figure it out. I was close to creating a new channel and fiddling with some SQL to transfer my test data from the broken channel into the working one!
    – Lea Hayes
    Dec 14, 2012 at 8:24
  • I thought this bug with Publish Layouts got fixed in 2.5.3? Dec 14, 2012 at 10:49
  • @JamesSmith I am using 2.5.3 and I can confirm that it hasn't (even if it was supposed to have been) :-)
    – Lea Hayes
    Dec 14, 2012 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.