[pmwiki-users] cookbooks SelectQuery and UpdateForm

Piotr Dybczyński piotr at dybczynski.pl
Wed Jun 21 23:36:50 PDT 2023


Hi Petko,

i have several serious problems with PmWiki after upgrading to Debian 12 
(PHP 8.2) (I have also upgraded PmWiki to the latest).

Gregor Klarič <klaric.gregor at gmail.com> helped me a few days ago with 
the outdated cookbook PopupWindow.

All pages that use my databases do not work.

Some of them generate an error:

SQLSTATE[HY093]: Invalid parameter number: number of bound variables 
does not match number of tokens

but most of them show nothing (blank page).

What is really frustrating they also show blank page when I append 
?action=edit !!!

After ours of digging I found probable reason fo the abovementioned error.

The text of a simple page (working with PHP 7.3) was:

---------------------------------------------------------------------------

(:input form:)
(:input radio where value="s32_directory_p01 = 1":) '''Z pracy 
Garcia-Sanchez, 2001 (HIP) '''     

(:input radio where value="s32_directory_p02 LIKE '1'":) '''Z pracy 
Dybczyński, 2006 (HIP,TYC) '''     


\\

[++(:input submit value="Pokaż listę":)++]
(:input end:)
----
(:selectquery columns="s32_directory_code,s32_directory_name as 'Name'" 
tables=s32_directory  display=norowcount 
link=Name,Tests.Test3,s32_directory_code:)
------------------------------------------------------------------------

In some "magic" way the 'where' value had been passed to selectquerry.

Now under PHP 8.2 I have to replace selectquerry invocation with:

-------------------------------------------------------------------------
(:selectquery columns="s32_directory_code,s32_directory_name as 'Name'" 
tables=s32_directory where display=norowcount 
link=Name,Tests.Test3,s32_directory_code:)
--------------------------------------------------------------------------

i.e. adding explicitly 'where'.

I want to repair other pages in a similar way but I see blank pages when 
trying to edit.

It would be great if you can help!

All the best,
Piotr
-- 
/************************************************************************
                          dr Piotr A. Dybczyński
  homepage: https://www.dybczynski.pl/Piotr   e-mail: piotr at dybczynski.pl
******************************************************************PAD***/
W dniu 21.06.2023 o 19:10, Petko Yotov pisze:
> SelectQuery has a relatively recent release selectquery4.0.php which 
> appears to work in PHP 8.2.3.
> 
> I don't use the recipe and haven't tested everything, but was able to 
> have a query displayed correctly with no warnings.
> 
> 
> UpdateForm also has a recent version updateform7.php that I modified to 
> fix one initial fatal error.
> 
> Line 74, initially like this:
> 
>    while (count(@$opt['']) > 0 && count($args) > 0)
> 
> Changed to look like this:
> 
>    while (count((array)@$opt['']) > 0 && count($args) > 0)
> 
> I don't use the recipe and haven't tested everything, but was able to 
> have a query select field auto-filled correctly with no warnings.
> 
> Let us know if you notice any other problems.
> 
> Petko
> 
> 
> On 21/06/2023 18:01, Piotr Dybczyński wrote:
>> Hi all,
>>
>> is there anybody who could adapt these two cookbooks to PHP 8.2?
>>
>> I have several PmWiki pages talking to my databases and after
>> upgrading to Debian 12 they do not work.
>>
>> Great thanks in advance,
>> Piotr




More information about the pmwiki-users mailing list