Support » Networking WordPress » Subsite is not fetching existing user list when adding existing users

  • Hello Team,

    Recently we are facing an issue after we updated server to php 7.1. The issue is arising when we are trying to add existing users as Site Owner(a custom role with all admin facilities excluding uploading and deleting theme, plugins) in sub-sites under parent network. Unfortunately, the ajax is giving error and the autocomplete function is failing to work. Can you please suggest some way out ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    If you have an exiting user already properly added to a sub-site, you could use phpMyAdmin to copy the appropriate user meta to other users. This is a fairly advanced, hacky approach that must be very carefully done or else you could seriously bork your DB. Even if you are a total expert, you would then know that you should always make a backup before making any changes.

    The real solution is to correct whatever is causing Ajax and other scripts from working correctly. Then you can use the normal UI to do this with little risk of things going very wrong. Exactly what JS errors are you seeing in your browser console? What admin screen were you on and exactly what did you try to do? Give enough detail so that someone could try to replicate your error on another installation.

    Hello,

    I am working on some server which I don’t have access for db or any other files. I can do all these in localhost. But did you notice the problem I pointed out ? It is the site owner (custom role) which is not able to add existing users from parent network to sub-site. An administrator can do this still with no issues. After upgrading to php 7 we are facing this issue. Would be helpful if you can help me out in this.

    I am getting this error .

    TypeError: invalid ‘in’ operand a in load-scripts.php

    Moderator bcworkz

    (@bcworkz)

    You did not state in your OP that other admin users had no problems, an important detail.

    At what line number did this error occur? What version of WP are you running?

    debarati

    (@debarati)

    Hello,

    Thanks for your reply. Getting this error in line no 2.

    WordPress version is 4.7.11 and PHP version is 7

    Moderator bcworkz

    (@bcworkz)

    Something is not adding up. Line 2 of load-scipts.php in 4.7.11 is empty and could not be the cause of an error. “TypeError: invalid ‘in’ operand a” is not even normally a PHP error AFAIK.

    Where this error usually occurs is in jQuery when trying to parse a string as an array. The solution there frequently is to pass the string through jQuery.parseJSON() before trying to do anything with the data. I’ve no idea if this even applies to you, it’s merely a common cause and solution of the error you quoted.

    OTOH, you have a problem with a particular role, but admins don’t have such a problem. This usually points to a capabilities issue of that role. Could that role have unique script running that’s different than what admins have running? Maybe that script is failing to .parseJSON() before doing something with the data?

    I hope this helps some, unfortunately I don’t have enough meaningful information that would point to a definitive solution.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.