Loading...
 
Features / Usability

Features / Usability


Re: Passing variable to wiki page sql

posts: 214

It looks like the substituting of variables for "?"s, in the SQL plugin, has not worked for a while. Maybe since Tiki 2? But the code to handle the substitution is still in the SQL plugin.

At some point, maybe in Tiki 3, the

Copy to clipboard
extract ($params,EXTR_SKIP);

statement was changed to require all the possible parameters to be defined in the params array. But the 0,1,...9 parameters were never added to the params array in the SQL plugin.

Since they are not defined in the params array, the "extract" ignores and never extracts them, and they are missing when it goes to use them to replace the "?"s, resulting in the "Missing db param" error message, even though they are present.

In a Tiki 12 version of the SQL plugin, I added the first number parameter, '0', to the params array, tested it, and it worked.

But, there is another problem which probably makes this parameter option not very useful, even if the 0-9 options are added to the params array.

Every time the code in a SQL plugin changes, the plugin will require approval before it will run.

The security fingerprint hash for the SQL plugin is generated from the plugin parameters and the SQL statement. Each time one of the numbered parameters changes, the SQL plugin would need to be validated again. If you used the 0=>$user, every time the user changed, the plugin would require validation.

You might consider writing your own plugin to generate your secondary pages.

Tom

There are no comments at this time.