Fork me on GitHub

[solved] zikula 1.3 pnForm calls broken  Bottom

  • I am working on moving the quickcheck module to be 1.3 compatible and have run across this error. Here is the code that used to work fine in zikula 1.2.4

    Code

    function quickcheck_admin_newTextQuest($args) {
       if (!SecurityUtil::checkPermission('quickcheck::', '::', ACCESS_ADD)) {
            return DataUtil::formatForDisplayHTML(_MODULENOAUTH);
        }

        $pnForm = FormUtil::newpnForm('Quickcheck');

        return $pnForm->execute('quickcheck_admin_new_text_question.htm', new quickcheck_admin_newTextQuestionHandler());
    }


    It now gives me this error in the phplog file.
    PHP Fatal error: Call to undefined method quickcheck_admin_newTextQuestionHandler::setView() in /Applications/MAMP/htdocs/zikula_1_3/lib/Form/View.php on line 168

    Any ideas? Thanks in advance
  • Please log a ticket at code.zikula.org/core/newticket and please include the test case so fixing this issue will be easy.

    --
    Zikula Lead Developer
    Board Member of the Zikula Foundation
    Follow me on twitter.com/zikuladrak
  • I think newform needs 2params now. You also need $this as 2nd param. Could that be it ?

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • No. This is something else (and not required for 1.2). This issue requires a ticket.

    Drak

    --
    Zikula Lead Developer
    Board Member of the Zikula Foundation
    Follow me on twitter.com/zikuladrak
  • okido

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • Actually looking at this, does your form handler inherit from pnFormHandler? Could you email me the handler please? drak /a-t/ zikula dot org

    Drak

    --
    Zikula Lead Developer
    Board Member of the Zikula Foundation
    Follow me on twitter.com/zikuladrak
  • Thanks Drak,

    I added the ticket. It's at Ticket #2773. To reproduce the bug I added the module with directions on how to fix it.
  • Hi. I've answered the ticket after looking at the code. Your handler is supposed to inherit from pnFormHandler e.g.:

    class quickcheck_admin_newTextQuestionHandler extends pnFormHandler {

    This has always been the case although it seems many people have not done this due to missing typechecking in the pnForm package.

    Drak

    --
    Zikula Lead Developer
    Board Member of the Zikula Foundation
    Follow me on twitter.com/zikuladrak
  • Thanks drak,

    BTW, I followed the examples for pnForms and I may have missed the extends. On to coding again....

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