Jump to content
manlio

Enabling front-end editing give me an error

Recommended Posts

Hi! I have a problem using front-end editing PW capabilities. I'm using the latest legacy version and I have enabled it, but when I'm in frontend (logged as admin) I get this error in Chrome console

Uncaught ReferenceError: ProcessWire is not defined
    at ckeLoadPlugins (InputfieldCKEditor.js?v=157-1475222106:17)
    at InputfieldCKEditor.js?v=157-1475222106:22

I tried to disable some modules but it still doesn't work.

Anyone have a suggestion how to fix this problem?

Thank you!

Share this post


Link to post
Share on other sites

I know this is a little late and it shouldn't happen when using the built-in front-end editing, but when I use frontend forms that need some core js, like AsmSelect fields, since PW 3, I now need to do this to define "ProcessWire" in js.

<script type="text/javascript">
<?php $jsConfig = $config->js(); ?>
  var ProcessWire = {config: <?php echo json_encode($jsConfig); ?>};
</script>

 

  • Like 3

Share this post


Link to post
Share on other sites

Thank you adrian, your reply is still helpful because I started working on other things and I didn't find time to investigate more on this (it is not mandatory).

I have added the script in the header and now the error message has changed in

Uncaught TypeError: Cannot read property 'plugins' of undefined
    at ckeLoadPlugins (InputfieldCKEditor.js?v=157-1475222106:17)
    at InputfieldCKEditor.js?v=157-1475222106:22
ckeLoadPlugins @ InputfieldCKEditor.js?v=157-1475222106:17
(anonymous) @ InputfieldCKEditor.js?v=157-1475222106:22

Thank you as usual for your amazing support.

As soon as I can work on this I will try to remove some javascript to see if something change.

Share this post


Link to post
Share on other sites

Have you tried replacing your entire wire folder? Also, what version are you running - I assume 3.x, but perhaps try upgrading to the latest to see if that helps.

  • Like 1

Share this post


Link to post
Share on other sites

Just as reminder for others.

In my case inline editing in PW 2.8.35 don't work, updating to PW 3 fix the issue (although I prefer remaining on 2.8).

Thanks adrian for your always present support.

Share this post


Link to post
Share on other sites
On 2/18/2017 at 5:04 AM, adrian said:

I know this is a little late and it shouldn't happen when using the built-in front-end editing, but when I use frontend forms that need some core js, like AsmSelect fields, since PW 3, I now need to do this to define "ProcessWire" in js.


<script type="text/javascript">
<?php $jsConfig = $config->js(); ?>
  var ProcessWire = {config: <?php echo json_encode($jsConfig); ?>};
</script>

 

Thank you for this very valuable piece of information.

After implementing this in the head I still got a JS error: ReferenceError: config is not defined.

I had to adjust the code like this to make it work:

<script type="text/javascript">
<?php $jsConfig = $config->js(); ?>
  var ProcessWire = {config: <?php echo json_encode($jsConfig); ?>};
  var config = ProcessWire.config;
</script>

No idea why my frontend form didn't pick up config from the ProcessWire object. 

Share this post


Link to post
Share on other sites

I am using LoginRegister module (with PW3.x) and wanted to get CKEditor working for the user profile page bio.
The modification from gebeer SOLVED it. Thanks.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...