Are custom action handlers still supported?

Author Message

Thiago Campos Viana

Thursday 10 February 2011 8:52:40 am

I tried to create but I had some problems, it doesn't work at all.

I created the content.ini.append.php:

[ActionSettings]
ExtensionDirectories[]=dappsocial

Then I created the file content_actionhandler.php inside the extension actions folders:

<?php

function dappsocial_ContentActionHandler(&$module, &$http, &$objectID){

    if($http->hasPostVariable("hello")) {
        echo $http->postVariable("hello");
        exit;

    }
    echo 'does it works?';
    exit;
    return true;
}
?>

Finally I created a form in a template:

<form action="{"content/action"|ezurl}" method="post">

<input name="hello" type="submit" value="Olá mundo!" />

<input name="ContentObjectID" type="hidden" value="50" />

</form>

And it doesn't work, the code is not called at any time... Am I doing something wrong or it is not support anymore?

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

Thiago Campos Viana

Thursday 10 February 2011 10:55:25 am

Nevermind, I found the error:

<form action="{"content/action"|ezurl}" method="post">

It's not supposed to has ", the correct is:

<form action={"content/action"|ezurl} method="post">

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

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 18 2025 02:03:25
Script start
Timing: Jan 18 2025 02:03:25
Module start 'layout'
Timing: Jan 18 2025 02:03:25
Module start 'content'
Timing: Jan 18 2025 02:03:25
Module end 'content'
Timing: Jan 18 2025 02:03:25
Script end

Main resources:

Total runtime0.0169 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.0469152.6406
Module start 'layout' 0.00580.0037 740.687539.4844
Module start 'content' 0.00950.0050 780.171989.4141
Module end 'content' 0.01450.0023 869.585934.2891
Script end 0.0168  903.8750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002716.1425140.0002
Check MTime0.00127.2511140.0001
Mysql Total
Database connection0.00084.768110.0008
Mysqli_queries0.002917.211530.0010
Looping result0.00000.100410.0000
Template Total0.001911.010.0019
Template load0.00116.262710.0011
Template processing0.00084.691710.0008
Override
Cache load0.00074.430110.0007
General
dbfile0.00031.585180.0000
String conversion0.00000.046740.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