Fork me on GitHub

Variables passed to block functions (usually $row)  Bottom

  • Hi!

    I'm trying to write a module, that would combine functionality of two other modules. One of them is core/menu ("General menu"). The problem is that text that I enter to input fields (name of link, and its value) is not passed to function that updates block content in database. Normally this text is passed in form of arrays (link_name and link_url if I remember correctly) in $row array. But in this case these values are not passed (although others are). What is the mechanism of passing these values from input fields? Where shold I look for error?

    Apache 2.0.50, PHP 5.0.0, MySQL 4.0.20d, ActivePerl 5.8.0.810 and PN .750

    TIA

    Chris
  • I'm a big fan of print_r($someVar) when $vars don't seem to be being passed. Sometimes I'm simply referencing them by the wrong $varName...
  • print_r() - a very useful function :D

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • Yessirree... Without it I'd have been dead in the water...hundreds of times... Just be careful using it on database query results...it prints the user/pass in plain-text...
  • I gained some very interesting results print_r()'ing the adobDB result object - learned a few things.

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • You're not kidding... I couldn't believe how much information was housed in it. Amazing...the things one can discover by accident...which is how I discover most things.
  • First of all, I'm sorry for calling a block module in my first post in this thread. But I guess that given the name of this forum you got it right.
    print_r... Well, that was the first thing that I tried. How else would I know what exactly is inside $row? So I know that in my block there are no variables linkname and linkurl in $row table in update function, but they are in original core/menu update function. Generally all values from input fields are assigned to variables with pnVarCleanFromInput. But core/menu first checks $row['linkname'] with isset. And my question is: how are these values passed to update function, because function, that allows editing block content returns only HTML $output? I've also noticed that in my function "weight" parameter is set to 1, and in original to 2. What is that parameter?
    Could it be that my problem is somehow related to security?
    Or maybe - is it possible that creating $output in edit function with "new pnHTML();" then converting to HTML with "$output = $output->GetOutput();" and then adding additional outuput with ".=" gives me the trouble?

    TIA

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