loadSchema: no tableName specified!

5 posts by 2 authors in: Forums > CMS Builder
Last Post: May 5, 2016   (RSS)

By andreasml - May 3, 2016

Update to the previous message.

I found that this happens when the user access level is set to either "Viewer" or "Author & Viewer". 

When the access level is set to "None" or "Author" or "Editor" the message does not appear.

Is there a bug somewhere?

AndreasML

By gregThomas - May 3, 2016

Hey Andreas,

Thanks for bringing this issue to our attention, I've been able to recreate it on a test installation. I'll update you once we've resolved it. 

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By gregThomas - May 5, 2016

Hey Andreas,

We've tracked down what's causing the problem, the issue will be resolved in the next release of CMS Builder. For now you can patch the issue by changing /lib/user_functions.php on line 39 from this:

  // don't allow viewer-only access unless section allows it
  if ($accessLevel == 3 || $accessLevel == 7) {
    $schema = loadSchema($tableName);
    if (@$schema['_disableView']) {
      if ($accessLevel == 7) { $accessLevel = 6; } // drop author/viewer access to author only
      else                   { $accessLevel = 0; } // drop viewer only access to no access
    }
  }

to this:

  // don't allow viewer-only access unless section allows it
  if ($accessLevel == 3 || $accessLevel == 7) {
    if($tableName){
      $schema = loadSchema($tableName);
      if (@$schema['_disableView']) {
        if ($accessLevel == 7) { $accessLevel = 6; } // drop author/viewer access to author only
        else                   { $accessLevel = 0; } // drop viewer only access to no access
      }
    }
  }

As this is a change to a core CMS Builder file, ensure you've made a full backup of your CMS directory (including the database) before adding this change. 

Let me know if you have any questions. 

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By andreasml - May 5, 2016

Thank you Greg

I will try it and let you know

Kind regards

Andreas ML