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

Kernel overrides can't be used for override operation related classes

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • 4.7.0-dev, 4.6.0
    • Legacy > Workflows, Misc
    • None

    Description

      Hi. You can override some kernel classes with the kernel override feature, but as said in some threads like http://share.ez.no/forums/developer/override-kernel-classes, the use of include calls can make this feature don't work as expected.

      This is one of the cases. A quick fix is comment or delete this line
      https://github.com/ezsystems/ezpublish/blob/master/lib/ezutils/classes/ezmoduleoperationinfo.php#L755
      i've tested and work as i would expect.

      But i think we can also changes lines like

      'default_call_method' => array( 'include_file' => 'kernel/shop/ezshopoperationcollection.php',
                                                                             'class' => 'eZShopOperationCollection' ),
      

      to avoid the include_file definition, and probably get ride of it in the ezmoduleoperationinfo.php (i mean, delete it from function parameters and so on)

      Steps to reproduce
      • Be sure you have
        define( 'EZP_AUTOLOAD_ALLOW_KERNEL_OVERRIDE', true );
        
      • Enable content_read operation in workflow.ini override
      • copy kernel/content/ezcontentoperationcollection.php to extension/[yourextension]/classes/
      • Modify readObject funciton in the copied class. add there something dummy, for example
         eZLog::write( "Starting to read" );
        
      • regenerate your autoloads with php/bin/ezpgenerateautloads.php -e -k -o
      • Try to load any content on your install, for example, your home page.

      Expected result: you should see somethin in var/log/common.log
      but you won't see nothing...

      Attachments

        Activity

          People

            unknown unknown
            desorden desorden
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: