neonwired

Error: Call to a member function hasPermission() on null

1 post in this topic

Just had an entire site go down with the following error :

Error: Call to a member function hasPermission() on null (line 1289 of /opt/bitnami/apps/processwire/htdocs/wire/core/Modules.php) 

Any idea what is causing 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 sirhc
      Hi all,
      I got a Internal Server Error when accessing de /setup/fields in my back end...
      Also when i try to reach it through the page tree, i can't edit the 'fields' page, same error.
      I do modify a image field through the api, i don't know if that has something to do with it, below the code i use to upload an image through the api, I deleted the parts that are not important. If anyone can help me that would be great.
      To clarify; the code below works fine, my image and page is created as expected, the only thing is that I can't access my /setup/fields/ page in my CMS anymore due to the Internal Server Error.
       
       <?php              if($input->post->submit) {             $photoPage = new Page(); // create new page object             $photoPage->template = 'photo'; // set template             $photoPage->parent     = wire('pages')->get('/foto/'); // set the parent                          $photoPage->name     = urlBuilder($input->title_photo); // give it a name used in the url for the page             $photoPage->title     = $input->title_photo; // set page title (not neccessary but recommended)                          $photoPage->save();                              // next: process photo upload                          // Set a temporary upload location where the submitted files are stored during form processing             $upload_path = $config->paths->assets . "files/photos/";                          // New wire upload             $file_upload = new WireUpload('file_upload'); // References the name of the field in the HTML form that uploads the photo             $file_upload->setMaxFiles(1);             $file_upload->setOverwrite(true);             $file_upload->setDestinationPath($upload_path);             $file_upload->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif'));                          // execute upload and check for errors             $files = $file_upload->execute();                          // Run a count($files) test to make sure there are actually files; if so, proceed; if not, generate getErrors()             if(!count($files)) {                 $file_upload->error("Sorry, but you need to add a photo!");                 return false;             }             //success                          //echo 'photos stored';exit;                                  $photoPage->save();             //$session->redirect($locationPage->url);         } else {      ?> <section class="add-location">     <div class="container">         <div class="row">             <div class="col-xs-12">                      <h2>Spot toevoegen</h2>                 <form id="add-form" action="" enctype="multipart/form-data" method="post">                     <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>" />                                          <div class="col-xs-12 col-md-6">                             <label for="fileselect">Upload jouw foto:</label>                         <p>                                                          <input type="file" name="file_upload" id="file_upload" accept="image/*"  class="inputfile" />                             <label for="file_upload">                                 <span></span> <strong><i class="fa fa-upload" aria-hidden="true"></i>                                 Kies je foto…</strong>                             </label>                                                      </p>                         </div>                                                  <input type="submit" name="submit" value="Upload" />                     </div>                 </form>                  </div>         </div>     </div> </div> <?php } } include('./includes/foot.php');?>  
    • By hellomoto
      mamo_length_ft is not a field. I don't see it anywhere in the database neither. Where could this possibly be stemming from?
    • By gebeer
      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:

      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
    • By hacsor
      Hi
      I have a existing project in Foundation 6 with some jQuery plugins,  and I'm try to move to Processwire, but  it shows a Revolution Slider Plugin error when I open index page .
      How can I solve this?
      Thanks!

    • By cosmicsafari
      Hi All,
      Fairly new to ProcessWire so apologies if this is a daft question, but I am having a go creating my first module. I have set it up and enabled it as per the docs.
      However I have created another class within the same module directory, which was going to be used in the main module file but I can't get it to work for the life of me and I believe its due to me not fully understanding the namespace side of things.
      Example:
      MyModule.module.php
      <?php namespace ProcessWire; class MyModule extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Test Module', 'version' => 1, 'summary' => 'Test module', 'href' => '', 'singular' => true, 'autoload' => true, 'icon' => 'exchange', ); } public function newMethod( $testMessage ) { $foo = new Foo($testMessage); $foo->getFoo(); } } Foo.php
      <?php namespace ProcessWire; class Foo { protected $foo; public function __construct($foo) { $this->foo = $foo; } public function getFoo() { return $this->foo; } } Now as I understand it both these files should exist under the ProcessWire namespace, so in theory I should be able to use Foo within MyModule without any use statements as they both exist at the same level within the ProcessWire namespace?
      However when I try something like so:
      $myModule = $modules->getModule('MyModule'); $myModule->myMethod('Foo'); I would have thought this should return 'Foo', however I keep running into errors like:
      Any help would be appreciated.