0

I don't find how to resolve this error.

Notice: Undefined property: CfgmService::$language_directory
Notice: Undefined property: CfgmService::$template_integration

the lines where the error :

'language_directory' => $m->language_directory,
'template_integration' => $m->template_integration,

Do you have any idea how to proceed ?

let me know if you need more informations.

Below the code in relation with error.

     class CfgModulesAdmin {

        public $_modules = [];
        protected $lang;

        public function __construct() {
          $Template = Registry::get('TemplateAdmin');

          $file_extension = substr(Core::getIndex(), strrpos(Core::getIndex(), '.'));
          $directory = $Template->getModulesDirectory()  . '/Module/CfgModules/';

          if ($dir = @dir($directory)) {
            while ($file = $dir->read()) {
              if (!is_dir($directory . $file)) {
                if (substr($file, strrpos($file, '.')) == $file_extension) {
                  $class = substr($file, 0, strrpos($file, '.'));

                  include($Template->getModulesDirectory()   . '/Module/CfgModules/' . $class . '.php');

                  $m = new $class();

                  if (is_object($m)) {
                      $this->_modules[] = ['code' => $m->code,
                                            'directory' => $m->directory,
                                            'language_directory' => $m->language_directory,
                                            'key' => $m->key,
                                            'title' => $m->title,
                                            'template_integration' => $m->template_integration,
                                            'site' => $m->site
                                          ];
                  }
                }
              }
            }
          }
        }
....
      }
Barmar
  • 741,623
  • 53
  • 500
  • 612
Tristan
  • 351
  • 1
  • 3
  • 8
  • 1
    Can you please also post the code for the CfgmService class? Thank you. – Bruno Leveque May 06 '19 at 22:56
  • It seems that you have classes as files in a directory, so you have to be sure that these files are there and initiated as objects well. So It will be better to give us a hint about your files structure. – SaidbakR May 06 '19 at 23:14
  • I found the problem, It was inside another class where these elements was not included in CfgmService. – Tristan May 06 '19 at 23:49

0 Answers0