Jump to content

I become this error while uploading my module. Warning: class_parents(): Class ProcessWire\TabButton does not exist and could not be loaded in C:\xampp\htdocs\processwire\wire\core\Functions.php on line 1059


Abe Cube
 Share

Recommended Posts

<?php namespace ProcessWire;
class TabExtension extends WireData implements Module {
  public static function getModuleInfo() {
    return [
      'title' => 'Foo test module',
      'summary' => 'An example of creating a module',
      'version' => 1,
      'summary' => 'Display message when pages are saved',
      'autoload' => true,
    ];
  }
  
  
  public function ready()
        {
            $this->addHookAfter('ProcessPageEdit::buildForm', $this, 'addButtons');
        }

 public function addButtons($event)
        {
            $page = $event->object->getPage();

            if ($page->template == "bewerbung") {
                $form = $event->return;
                $inputfields = new InputfieldWrapper();

                $tab = new InputfieldWrapper();
                $tab->attr('title', 'Settings');
                $tab->attr('class', 'WireTab');

                $markup = $this->modules->get('InputfieldMarkup');
                $markup->label = 'Settings';
                $markup->value = '<p>Just a placeholder for some inputfields.</p>';
                $tab->add($markup);

                $inputfields->add($tab);

                $form->add($inputfields);
            }
        }
}

Link to comment
Share on other sites

@Abe Cube please use the code input to post code: image.png.1924b5345bd3e5fbc86032578b10607f.png

Example: 

<?php namespace ProcessWire;
class TabExtension extends WireData implements Module {
  public static function getModuleInfo() {
    return [
      'title' => 'Foo test module',
      'summary' => 'An example of creating a module',
      'version' => 1,
      'summary' => 'Display message when pages are saved',
      'autoload' => true,
    ];
  }
  
  
  public function ready()
        {
            $this->addHookAfter('ProcessPageEdit::buildForm', $this, 'addButtons');
        }

 public function addButtons($event)
        {
            $page = $event->object->getPage();

            if ($page->template == "bewerbung") {
                $form = $event->return;
                $inputfields = new InputfieldWrapper();

                $tab = new InputfieldWrapper();
                $tab->attr('title', 'Settings');
                $tab->attr('class', 'WireTab');

                $markup = $this->modules->get('InputfieldMarkup');
                $markup->label = 'Settings';
                $markup->value = '<p>Just a placeholder for some inputfields.</p>';
                $tab->add($markup);

                $inputfields->add($tab);

                $form->add($inputfields);
            }
        }
}


 

  • Like 2
Link to comment
Share on other sites

Thank you BitPoet for your reply. Yes I uploaded the correct file. TabExtension and TabButton are two different modules but for both of them I got the same error message. I accidently posted the wrong pic for my code, but the error messages are similar.

Link to comment
Share on other sites

  • 2 years later...

@Abe Cube - I know this is very old, but perhaps it will help someone else. I just had this same error and it turns out is was due to a mismatched class name and file name. I was testing something and my file was a typo: ProcessHiddenPageText.module.php while the class name was the correct ProcessHiddenPageTest.module.php

As soon as I fixed the filename and did a modules refresh, everything worked as expected.

  • 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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...