Hi all,
I've been fighting the .762 upgrade (on a test site rather than my real, of course) to upgrade from .726 upwards.
I've got two custom modules that do mostly the same thing (just some small differences in HTML formatting and keeping the DB tables separate for easier handling) for reviews and articles. These were forked off of the .726 reviews module, the only major changes have to do with it storing some different data in the database to allow me to create my content as HTML files rather than sitting it all inside the database.
However, whenever the items are referenced (as in, http://sitename.com/modules.php?op=modload&name=HTMLReviews&file=index&req=All), no matter what the command on req is - a letter, write_review, showcontent, or anything else - it just defaults back to the reviews() function and shows the main reviews list.
Does anyone know why .762 might be doing this? I've found a few other errors here and there, but it all seems to be coming back to post-nuke .762 not passing those arguments to the module correctly, and I don't know what the alternate format is or how to fix it because all the documentation for PostNuke is MIA lately as you gear up for .80 (grr).
I could theoretically sit down and attempt to recode the modules from the .762 version provided, but that's going to be painful if I have to do so.
Login
Donate to Zikula
Module Development
::
Upgrading to .762 breaks my custom modules... sort of
-
-
By the by, the links to pnGuide (not that I think it'll help but just FYI) in your download section are broken.
-
You mention the modules are based on .726 code. The problem is likely then that your modules simply asssume that the variables passed via GETs (i.e. in the URL) exist in your script. This hasn't been the case in .750 and was a key security enhancement in this release.
You must obtain variables from input (GET and POST) via the pnAPI. i.e.
Code
$myvar = pnVarCleanFromInput('myvar')
-Mark -
Moryath
Hi all,
I've been fighting the .762 upgrade (on a test site rather than my real, of course) to upgrade from .726 upwards.
I've got two custom modules that do mostly the same thing (just some small differences in HTML formatting and keeping the DB tables separate for easier handling) for reviews and articles. These were forked off of the .726 reviews module, the only major changes have to do with it storing some different data in the database to allow me to create my content as HTML files rather than sitting it all inside the database.
I can relate to your frustration - I really feel like I am in nowhere land at the moment - there are features that function in .762 I would like to have on my site - but then there are modules for .750 that just dont work in .762.
So what is one to do? The move seems to be toward .8 and there is no stopping it - do we upgrade to .762 try to get developers to create modules and cross our fingers that .8 won't break them.
Just little things like this sometimes make me ask whether PostNuke is really the solution for me...
-
No, that's not it.
The code is the same in .726, for instance:
Now, in the .726, the URL would pass the req= item to $letter and it worked fine. In .762 for some reason, $letter is now coming out blank, unless I change the URL to something like this:Code
function reviews()
{
list($letter,
$field,
$order) = pnVarCleanFromInput('letter',
'field',
'order');
Code
http://sitename.com/modules.php?op=modload&name=HTMLReviews&file=index&letter=All
rather than this:
http://sitename.com/modules.php?op=modload&name=HTMLReviews&file=index&req=All
Similar problems occur trying to reference other functions (req=write_review would previously send you to the review writing dialog, and now just bounces back to the reviews() function).
The larger question is that if the req= catchall is now invalid, how do I get the module to recognize its other functions from the URL? I can recode the various portions to reference each other fairly easily if I can find out what the HTML formatting needs to be. -
It seems that you don't obtain the 'req' parameter from the URL. You probably need this just before switch that acts on the 'req' parameter.
i.e.
Code
$req = pnVarCleanFromInput('req');
switch ($req) {
case 'something':
.....
case 'somethingelse'
.....
}
pnVarCleanFromInput will not map one input variable to a complete random PHP variable. The order of the PHP variables and the parameters to pnvarcleanfrominput match exactly.
If in doubt check the .762 reviews module for the differences.
-Mark -
Tastiger,
Any fully pnAPI compliant module will work in any PN version from the version it was designed for onwards (obviously newer technologies won't be used). Any module not written using pnAPI compliant techniques cannot be guarenteed as security is tightened in each subsequent release.
Most PN modules are GPL'd so the source is freely available for anyone to fix.
-Mark -
markwest
It seems that you don't obtain the 'req' parameter from the URL. You probably need this just before switch that acts on the 'req' parameter.
i.e.
Code
$req = pnVarCleanFromInput('req');
switch ($req) {
case 'something':
.....
case 'somethingelse'
.....
}
pnVarCleanFromInput will not map one input variable to a complete random PHP variable. The order of the PHP variables and the parameters to pnvarcleanfrominput match exactly.
If in doubt check the .762 reviews module for the differences.
-Mark
Well, that got it a lot closer - it's trying very hard to work now, I'd say 90%. Turns out there is a catchall way down in the rear end of both files and you were right, only the .762 one had that $req=pnvarcleanfrominput statement.
Still some things to sort out (it's no longer sorting out some of the includes, but I think that's something that got changed in referencing code).
