Jump to content

TypeError: a.ProcessPageList is not a function in Admin


gebeer
 Share

Recommended Posts

Hello,

I'm getting a JS error in the admin backend when editing pages with template basic-page as non superuser:
TypeError: a.ProcessPageList is not a function in InputfieldPageListSelect.min.js

Investigating the JS, I found that the ProcessPageList function is not available on the page when I am logged in as a non superuser. 

The function is defined in /wire/modules/Process/ProcessPageList/ProcessPageList.min.js which is not loaded when logged in as non superuser.

When logged in as a superuser, the file gets loaded.

I have no fancy permission settings for that template for the role admin that the non superuser belongs to:

58ddc6a057b72_2017-03-31100110.thumb.png.665b0b9cb36a6de3dbfc971cc997691f.png

This started happening on a site that is in development but online for some time now. I can't say which actions might have caused this. But it is a consistent error only for this one template.

The site is running on 3.0.42

EDIT: The inputfield triggering the error is an image field (in fact there are 2 of them in that template)

Any pointers to potential causes for this problem would be much appreciated. 

EDIT: The problem is not related to any file changes. When I run the same install with a DB backup, the error disappears. So it must be something that has changed in the DB. Trying to diff the DB dumps and see if I can find anything suspicious

Link to comment
Share on other sites

UPDATE: I couldn't find anything suspicious in the DB dump diff. So after tinkering for a while I decided to try a workaround.

I added a new role and gave it the same template-level permissions as the 'faulty' role that caused the problems. Then I assigned this new role to the admin user with the old, 'faulty' role (in addition to the old one).

And this helped, the JS error is now gone.

Not sure, though, what to make of this. It seems to be pointing to a problem in the settings for that 'faulty' role. But I went through the role and permission settings numerous times and couldn't find anything unusual.

So for now I will let it be as it is. Although I really would like to find the real cause of the problem. Just don't know where else to look for it. Feels a bit uncomfortable to have a site running in production with a strange admin error that might reappear anytime...

So if anyone reading this has an idea, please let me know. But thanks for reading anyways.

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

Hi @gebeer - I just came across this - one of my site editors gets this error when trying to edit a PageTable or Repeater field that contains images. I haven't investigated much yet, but was wondering if you ever found out anything more on this?

It seemed to come out of the blue, but maybe it was related to a PW core update? What version are you running?

Link to comment
Share on other sites

@adrian unfortunately I couldn't find the reason for this. My workaround with the new user is still working, though.

The install where the error occured is running on 3.0.42. I can't say if it was related to an update. Really stepping in the dark on this one...

  • Like 1
Link to comment
Share on other sites

6 minutes ago, gebeer said:

@adrian unfortunately I couldn't find the reason for this. My workaround with the new user is still working, though.

The install where the error occured is running on 3.0.42. I can't say if it was related to an update. Really stepping in the dark on this one...

Thanks - unfortunately creating a new role to assign to the user isn't working for me - I'll take a better look tomorrow and see what I can figure out.

Cheers.

Link to comment
Share on other sites

I don't have much time to figure out why at the moment, but I discovered that InputfieldPageListSelect::renderReady is not being called for non-superusers. It is inside this that the ProcessPageList module is loaded, so as a quick hack so I can move on for now, I added:

if($page->template->name == 'admin' && $user->isLoggedIn()) $this->wire('modules')->get('ProcessPageList');

to site/ready.php which gets things working properly again.

I hope to find some time to get back to this and investigate properly, but if anyone else has any ideas that would be awesome :)

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Hey @gebeer - I just stumbled across this again - do you know if this was ever reported on Github?

I am still using that hack here on a couple of sites, but not sure if it's still needed, so just wondering if you had any more recent info on it.

Link to comment
Share on other sites

On 3/4/2019 at 10:46 PM, adrian said:

Hey @gebeer - I just stumbled across this again - do you know if this was ever reported on Github?

I am still using that hack here on a couple of sites, but not sure if it's still needed, so just wondering if you had any more recent info on it.

I did not run into this again and it happened only on that one install which has not been upgraded since. So I'm afraid, I can't tell...

  • Like 1
Link to comment
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
 Share

×
×
  • Create New...