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.

eZ debug

Timing: Jan 30 2025 00:44:54
Script start
Timing: Jan 30 2025 00:44:54
Module start 'layout'
Timing: Jan 30 2025 00:44:54
Module start 'content'
Timing: Jan 30 2025 00:44:54
Module end 'content'
Timing: Jan 30 2025 00:44:54
Script end

Main resources:

Total runtime0.0132 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.1563151.2109
Module start 'layout' 0.00450.0026 739.367236.6484
Module start 'content' 0.00710.0050 776.015690.0781
Module end 'content' 0.01200.0011 866.093833.9922
Script end 0.0131  900.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002216.8506140.0002
Check MTime0.00107.2649140.0001
Mysql Total
Database connection0.00053.936810.0005
Mysqli_queries0.002418.405030.0008
Looping result0.00000.097810.0000
Template Total0.00086.010.0008
Template load0.00064.498410.0006
Template processing0.00021.436710.0002
Override
Cache load0.00043.183110.0004
General
dbfile0.00107.725180.0001
String conversion0.00000.059840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs