PostNuke: A Flexible Open Source Content Management System
home | forum | international support | contact us

Support Forum

Start ::  Developers Corner ::  Module Development ::  error with pnForm

Moderated by: Support Team

Bottom
error with pnForm

  • Link to this postingPosted: 14.02.2008, 13:19
    Profile
    bolbit
    rank:
    pnFreshman pnFreshman
    registered:
     September 2007
    Status:
    offline
    last visit:
    14.02.08
    Posts:
    7
    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
  • Link to this postingPosted: 14.02.2008, 13:33
    Profile Homepage
    Guite
    rank:
    pnHelper pnHelper
    registered:
     January 2003
    Status:
    online
    Posts:
    140
    Delete the file system/pnForm/plugins/block.pnForm.php since it is replaced by system/pnForm/plugins/block.pnform.php

    -----
  • Link to this postingPosted: 14.02.2008, 13:46
    Profile
    bolbit
    rank:
    pnFreshman pnFreshman
    registered:
     September 2007
    Status:
    offline
    last visit:
    14.02.08
    Posts:
    7
    hello guite

    i searched my hole workspace after
    Quotefunction 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

  • Link to this postingPosted: 14.02.2008, 15:12
    Profile Homepage
    JørnWildt
    rank:
    pnHelper pnHelper
    registered:
     July 2002
    Status:
    offline
    last visit:
    05.05.08
    Posts:
    215
    Check the casing of in your template file.
  • Link to this postingPosted: 14.02.2008, 19:07
    Profile
    bolbit
    rank:
    pnFreshman pnFreshman
    registered:
     September 2007
    Status:
    offline
    last visit:
    14.02.08
    Posts:
    7
    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

Start ::  Developers Corner ::  Module Development ::  error with pnForm

Main Menu

Extensions Database

Documentation

Development

Login





 


 Log in Problems?
 New User? Sign Up!

Donate to PostNuke