Fork me on GitHub

error with pnForm  Bottom

  • Hello,

    i suppose i do not to see the wood for the trees, but i recieve an error when using pnForm.

    in my pnuser.php i do the following

    Code

    Loader::requireOnce('includes/pnForm.php');
    ...
    function test_user_addItem() {
       
        $render = &FormUtil::newpnForm('test');
       
        return $render->pnFormExecute('test_user_additem.tpl', new test_user_editItemHandler());
       
    }
    class test_user_editItemHandler extends pnFormHandler
    {
        var $id;
        function initialize(&$render)
        {
            $this->id = (int)FormUtil::getPassedValue('id', 0);
            return true;
        }
        function handleCommand(&$render, &$args)
        {
            if ($args['commandName'] == 'update') {
                if (!$render->pnFormIsValid())
                return false;
                $data = $render->pnFormGetValues();
                $data['id'] = $this->id;   
            }

            return true;
        }
    }


    When i call this function with
    index.php?module=test&func=addItem
    i recieve the following error

    Quote


    Cannot redeclare smarty_block_pnform() (previously declared in D:\workspaces\PHP\music\HTML\system\pnForm\plugins\block.pnform.php:19) in D:\workspaces\PHP\music\HTML\system\pnForm\plugins\block.pnForm.php on line 57
    Dictionary driver 'includes/classes/adodb/datadict/datadict-mysql.inc.php' not available


    I also installed the HowToPNForm module and this module works.

    So there must be a diffrent in the usage of pnForm in the how to and my test.

    But i just can not figure it out.

    Has anyone of you a suggestion where i do the mistake?

    Thanks a lot
  • Delete the file system/pnForm/plugins/block.pnForm.php since it is replaced by system/pnForm/plugins/block.pnform.php

    --
    Guite | ModuleStudio
  • hello guite

    i searched my hole workspace after

    Quote

    function smarty_block_pnform(

    but recieved only one match in

    system\pnForm\plugins\block.pnform.php

    After that i searched fpr the file
    block.pnForm.php

    I just find the file
    block.pnform.php

    I don't have a clue where the block.pnForm.php comes from.

    Also i wonder why the HowToPNForm works correctly withou this message

  • Check the casing of in your template file.
  • Hey Joern,

    you got it.

    The ending tag of pnform was misspelled.

    Now it worked.

    Thanks a lot



    edited by: bolbit, Feb 14, 2008 - 07:07 PM

This list is based on users active over the last 60 minutes.