billjoseph

Resolved: Adding image field disables CKEditor and fieldset

9 posts in this topic

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

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

Share this post


Link to post
Share on other sites

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

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

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

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

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

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
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!

1 person likes this

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 bmacnaughton
      When I delete a page name, e.g, /cart/, using the admin interface it goes into trash and gets the name /trash/2573.1.11_cart/ .
      I see that, with the Pages::trashed hook that the previous page name (previousPage) can be accessed.
      Where can I more information about what happens when a page is put into trash and what the name means?
    • By Kiwi Chris
      I'd really like Processwire to have a robust page based permissions system rather than just template based out of the box.
      If the page tree is compared to a file system, it would be nice to be able to set owner (user), group (role) and public permissions on a page and have this propagate to sub-pages unless explicitly over-ridden.
      With a large site, it's quite possible to have multiple sections that use the same templates, but where editing needs to be assigned to different people, for different parts of a site.

      I've seen some proofs of concept that have never been updated or maintained, so I'm sure it can be done, but this is a bit of a show-stopper for me with an otherwise excellent CMS.
      I might be able to have a go at something myself, but since this is security related, and I haven't had a go at module development before, it would be really handy to have something robust that just works.
    • By bmacnaughton
      When a PageTable field in a specific template is being edited I need to know the Page that contains the PageTable so I can fill in hidden fields in the PageTable.
      I can capture the page being edited via:
      // $this->addHookBefore('ProcessPageEdit::execute', ... public function pageEditExecuteBefore(HookEvent $e) { $p = $e->object->getPage(); if ($p->template !== 'rtw-product') return; // $p is the page being edited } I can intercept PageTable entry being saved:
      // $this->addHookBefore('Pages::save' public function savePageBefore (HookEvent $e) { $p = $this->wire('page')->id; $page = $e->arguments('page'); $obj = $e->object; $name = $page->name; // page name of PageTable page $template = $page->template->name; // template of PageTable page $parent = $page->parent->name; // parent directory for PageTable items What I am trying to find is the page in which the PageTable field is located.
      I've also tried having pageEditExecuteBefore() saving $p in $this->context and then accessing that in savePageBefore() but it's a different instance of the class because $this->context is null when it gets to savePageBefore(). I could save the page ID in session, but that seems error prone.
      Does anyone know how to achieve this?
    • By NorbertH
      I have a PW page that is about 2 - 3 Years old . 
      After an upgrade to Version 2.6  all  Pages and modules where gone in Admin backend. 
      As i had no time to look after the page i left it like it was for quite a while. 
      Now that i needed to get the Page online again i searched whith google anf fount that i should upgrade the page to PW 2.7.3
      As the Upgrade to 2.6 was done in a hurry , its perfectly possible that i accidentallly upgraded from 2.0 to 2.6. 
      Please have a look at the images to see the desaster in full color .... 
       
       


    • By alexcapes
      Hi,
      I just updated a site to 3.0.61 and it's breaking uploading images from a URL via the API.
      I get the following error:
      Recoverable Fatal Error: Method ProcessWire\Pageimage::__toString() must return a string value The code getting the image is very simple:
      $new_edition->work_cover = $cover_url; $new_edition->save('work_cover'); It works fine on 3.0.42 but returns the error on 3.0.61