Jump to content

[Solved] Error when I install a custom module


Marco Ro
 Share

Recommended Posts

Hi guys, I installed the latest this version of PW the 3.0.96. I notice this error when I try to install a custom module:

 

5ab3ac261cb80_Schermata2018-03-22alle14_13_41.thumb.png.1b108478751e4abaf3a655adfbc5f912.png

I try to install my module and this not works. But I also try to install the demo CustomPrices.module the on it's in the Padloper documentation and ugual doesn't work. So I think that maybe could be a bug of the new version.

I use: php 7.1.8 in localhost with mamp, server Apache, and run the last version of PW the 3.0.96.

Cheers

Edited by MarcoPLY
Link to comment
Share on other sites

Hi @zeka, thank you, So sorry but not work.

I added it this way:

<?php namespace ProcessWire;
class CustomPrices extends WireData implements Module {

    public static function getModuleInfo() {
        return array(
            'title' => 'Custom Prices',
            'version' => 1,
            'summary' => 'Example module for modifying prices in Padloper.',
            'singular' => true,
            'autoload' => true,
            'icon' => 'money',
            );
    }

 

But I Found the error! 

  • The name of  'title' => 'Custom Prices' need be the exactly the same of the file name in this case: CustomPrices.module

Sorry I didn't know this. Now the module is installed.

I correct my answer:

  • The name of  class CustomPrices need be the exactly the same of the file name in this case: CustomPrices.module

 

Edited by MarcoPLY
  • Like 1
Link to comment
Share on other sites

33 minutes ago, MarcoPLY said:

The name of  'title' => 'Custom Prices' need be the exactly the same of the file name in this case: CustomPrices.module

That's not actually true - it's the class name that has to match the file name.

  • Like 3
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...