Custom Edit Handler Publish function

Author Message

Jim Thaxton

Tuesday 29 December 2009 4:18:04 pm

I am creating a the custom edit handler for our site. I have the files in place and the new custom edit module available. When creating or saving an object in eZ, I can get to the FetchInput() function (I put a var_dump, exit or alternately an eZLog::write) but it never hits the publish functions.

After publish, I want to take the image(s) upload and perform some additional manipulation. I did this for another project in an earlier version of eZ and that code does not work exactly which leads me to believe I am missing something with the updates. Our site is on version 4.1.

Here is the code from my customedithandler.php function:

<?php
/* Custom edit handler for the Lux Goddess eZPublish Web site. On publish, new images and their aliases will be pushed to the cachefly cdn */
class customeditHandler extends eZContentObjectEditHandler{    function fetchInput( $http, &$module, &$class, $object, &$version, $contentObjectAttributes, $editVersion, $editLanguage, $fromLanguage  )    {          $logName = 'common.log';      $dir = 'var/log';      eZLog::write( 'fetchInput', $logName, $dir );

        }     static function storeActionList()    {        return array('publish');    }     function publish( $contentObjectID, $contentObjectVersion ) {          // fetch object      $logName = 'notice.log';      $dir = 'var/log';      eZLog::write( 'publish', $logName, $dir );            $object =& eZContentObject::fetch( $contentObjectID );
      var_dump($object);      // get content class object      $contentClass = $object->attribute('content_class');    } // publish}?><?php
/* Custom edit handler for the Lux Goddess eZPublish Web site. On publish, new images and their aliases will be pushed to the cachefly cdn */
class customeditHandler extends eZContentObjectEditHandler{    function fetchInput( $http, &$module, &$class, $object, &$version, $contentObjectAttributes, $editVersion, $editLanguage, $fromLanguage  )    {          $logName = 'common.log';      $dir = 'var/log';      eZLog::write( 'fetchInput', $logName, $dir );

        }     static function storeActionList()    {        return array('publish');    }     function publish( $contentObjectID, $contentObjectVersion ) {          // fetch object      $logName = 'notice.log';      $dir = 'var/log';      eZLog::write( 'publish', $logName, $dir );            $object =& eZContentObject::fetch( $contentObjectID );
      var_dump($object);      // get content class object      $contentClass = $object->attribute('content_class');    } // publish}?>

Web Developer
Coupon Cabin
Chicago, IL

Jim Thaxton

Tuesday 29 December 2009 6:47:58 pm

I realized my test return array('publish') should not be in the storeActionList() function. That should just have return array(); in it, I was curious if that would get content to the publish function but it did not.

Web Developer
Coupon Cabin
Chicago, IL

Jim Thaxton

Wednesday 30 December 2009 9:15:40 am

Sorry, sorted this one out. the Ez Environment I am working with has disabled the publishObjectExtensionHandler method so I need to find an alternate method to make my updates.

Thanks!

--Jim

Web Developer
Coupon Cabin
Chicago, IL

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.