billjoseph

Resolved: Adding image field disables CKEditor and fieldset

Recommended Posts

billjoseph    2

Weirdest thing just happened to me.  I updated blank site from 3.0.42 to 3.0.61 then started adding fields.  I have two instances of FieldsetOpen areas in the template, and a few CKEditor textareas (both inside those fieldsets and outside). 

I added an image field to the template and placed it near the top of the template fields.  Once I did that I was unable to toggle either Fieldset, and the CKEditor stopped working.

When I moved the image field to the bottom of the template fields, the CKEditor loaded, but the fieldsets still wouldn't toggle.  When I deleted the image field, the editor and toggle return to normal.  (Adding a new image field re-introduces the issues.)

I've tried adjusting the settings on the image field but the result is the same - even with all default settings.  I tried adding an image field to a different template - same result.

What am I missing here?

Share this post


Link to post
Share on other sites
tpr    2,222

Sounds like a JavaScript error, check the console (devtools).

Share this post


Link to post
Share on other sites
billjoseph    2

Console is showing a javascript error:

TypeError: u.cookie is not a function 

in

/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js:1:11297

 

Share this post


Link to post
Share on other sites
tpr    2,222

My best guess that it's a conflicting module, try disabling them one by one. You could also post your modules list, perhaps someone can identify the issue.

Share this post


Link to post
Share on other sites
billjoseph    2

Disabling modules didn't make a difference.  This is the list of modules:

Site - modules I added
Email Obfuscation (EMO)
Menu Builder: Markup
SEO
Markup Simple Navigation
404 Logger
Hanna Code
Menu Builder: Process
Hanna Code: Text Formatter

Core - these are the modules I activated,  the rest are in their default state as shipped
Reno
Select Options
CKEditor
Page Auto Complete
Forgot Password

 

Also realized that it's not just the fieldset toggles, but any field toggles that do not work.


 

Share this post


Link to post
Share on other sites
billjoseph    2

Checked the source of the page to see if jquery.cookie.js is being called before InputfieldImage.min.js.

It is, but it's returning a 406 Not Acceptable Error:
 

An appropriate representation of the requested resource /~mysite/wire/modules/Jquery/JqueryCore/jquery.cookie.js could not be found on this server.

Additionally, a 406 Not Acceptable error was encountered while trying to use an ErrorDocument to handle the request.

I checked the server and the file is there and in the correct place, and has content.

The actual line where the file is called is this:

<script type='text/javascript' src='/~mysite/wire/modules/Jquery/JqueryCore/jquery.cookie.js?v=1493077229'></script>

 

Share this post


Link to post
Share on other sites
billjoseph    2

Talked to my hosting company and the problem was apparently due to the temporary url structure for development:

server.com/~myaccount

They suggested editing my hosts file to bypass the DNS, which worked for me, but would be unwieldy for the client, so I created a subdomain that points to the IP:

dev.myurl.com

I had to add the new subdomain to my config.php file as one of the httpHosts, but it seems to be working just fine now.

Share this post


Link to post
Share on other sites
tpr    2,222

Is that a cPanel preview URL? I noticed that but thought if other scripts are OK then that couldn't be an issue.

Share this post


Link to post
Share on other sites
billjoseph    2
53 minutes ago, tpr said:

Is that a cPanel preview URL? I noticed that but thought if other scripts are OK then that couldn't be an issue.

It is, and it hasn't been an issue before. I don't know why just the one script was throwing the error, or why it started doing it now.

I'm just glad to have a solid workaround for the future.

And, tpr, thanks for your help in getting me pointed in the right direction so I could figure out where the problem was!

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By benbyf
      PW Admin doesn't really function without javascript, and my question would be, should we care?
      I think, however, either way it might be nice to add a "<span>Javascript doesn't seem to be available, therefore you may not be able to access the full functionality of the admin</span>" somewhere maybe?
    • By prestoav
      Now solved, see reply at the bottom.
      Hi all.
      PW version: 3.0.42
      Despite the usual speediness of PW, a site I'm working on at the moment is suffering an extremely slow load and save time in admin. We have the same site running on localhost (a brand new MacBook Pro with 3.1GHz processor / 16GB RAM) and a Media Temple VPS host both installations suffer in the same way.
      All pages open and save in admin very quickly with the exception of pages using one template which just happens to be the most used one (for products the site owner manufacturers).
      Opening the page to edit, or saving the page, can take more than a minute! The whole front-end of the site slows while this is happening. I should add that no caching is turned on at the moment, save the standard PW system. We are, however using the multi-language support with 6 languages installed.
      The template consists of the following number/type of fields:
      1x PageTitleLanguage  3x TextLanguage 4x Page 4x Repeaters (2-3 fields, typically text / image / textarea / page, in each - up to 10 entries per repeater) 1x RepeaterMatrix (3 fields in each, up to 3 entries per repeater) 2x TextArea 1x TextAreaLanguage 3x Image 8x Text Has anyone had an experience like this before? Is this expected behaviour with this number of fields in a page (it's the first time I've used this many on one template)?
      As always, any help would be gratefully received!
    • By rst
      Hello,
      I have repeater field with an image field as one of its fields. It works correctly on all but one templates. I added an image, it shows the image uploading, but then the image just disappears and it doesn't save. What could it be ?
       
      Thanks
    • By Gazley
      Hi there,
      I'm looking to render some square images that are based on portrait originals. When the image is selected, I'll display it in portrait mode but when the images are in a "summary" mode, I want them square. What would be the best way to generate a square image from a portrait original? FYI, I would ideally prefer these images to based on IMG tags and not background images.
      Cheers!
    • By hellomoto
      I have reduced the module to this and the same error persists:
      <?php class PortalDashboard extends Process implements Module { public static function getModuleInfo() { return array( 'title' => "Portal Dashboard", 'version' => "0.1", //'permission' => array("page-lister"), 'autoload' => false, 'singular' => true, 'permanent' => false, 'requires' => array("PHP>=5.4.0", "ProcessWire>=3.0", "CatCoCustoms"), ); } public function init() {} In the red:
      Furthermore
      When I uninstall the aforementioned module this doesn't happen, oddly enough. What could be the problem?