Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-12782

Invalid argument supplied for foreach() in ezmoduleoperationinfo.php

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 3.10.1, 4.0.1, 4.1.0alpha1
    • 4.0.0
    • Misc
    • None

    Description

      eZModule::globalPathList() returns null if you try to use it in pre checks, example of such a pre check is eZUserLoginHandler::checkUser().

      So if you try to run code like this "eZOperationHandler::execute( 'content', 'publish',..." in a pre check, you'll get a warning like this:

      Warning: PHP   Jan 18 2008 16:42:53
      
      Invalid argument supplied for foreach() in
      /opt/ezpublish/www/lib/ezutils/classes/ezmoduleoperationinfo.php on line 75
      
      Warning: PHP  Jan 18 2008 16:42:53
      
      Undefined variable: definitionFile in
      /opt/ezpublish/www/lib/ezutils/classes/ezmoduleoperationinfo.php on line 82
      
      Error: eZModuleOperationInfo::loadDefinition  Jan 18 2008 16:42:53
      
      Missing operation definition file for module: content
      
      Error: eZOperationHandler::execute  Jan 18 2008 16:42:53
      
      Cannot execute operation 'publish' in module 'content', no valid data
      

      It might be enough to move:

      $moduleRepositories = eZModule::activeModuleRepositories();
      eZModule::setGlobalPathList( $moduleRepositories );
      

      before:

      $check = eZHandlePreChecks( $siteBasics, $uri );
      

      in index.php

      Attachments

        Activity

          People

            oh oh
            andre1 andre1
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: