This board is the new home for david63's extensions.

All of the extensions hosted here will need to be treated as a new install as there is no migration from the original ones to these, and furthermore, no support will be given to migrating to any of these extensions from previous versions.


Due to the selfishness of certain board members it has become necessary to apply a limit of how many downloads each member can make before making a donation. Once a donation has been made then you will have unlimited downloads.

[3.3.0] Forum Subs

Fully working extensions
stone23
Donor
Donor
Posts: 75
Joined: January 2023

Re: [3.3.0] Forum Subs

#51

Post by stone23 »

GanstaZ wrote: 27 Mar 2023, 23:25
Does acp work normally on productions server when extensions are disabled?
Yes the ACP works normally, except for the links of all the deactivated extensions which are displayed only with the language keys, which is normal.

stone23
Donor
Donor
Posts: 75
Joined: January 2023

Re: [3.3.0] Forum Subs

#52

Post by stone23 »

devspace wrote: 28 Mar 2023, 09:50
One other question - are you using Cloudflare (or similar) which may be causing/contributing to the problem?
No, none of that...

User avatar
devspace
Owner
Owner
Posts: 280
Joined: October 2022

Re: [3.3.0] Forum Subs

#53

Post by devspace »

stone23 wrote: 28 Mar 2023, 11:57
except for the links of all the deactivated extensions which are displayed only with the language keys, which is normal.
That is not normal at all - do you have a screenshot?

The only place where I would expect to see language keys is in the ACP log.

How about your firewall - is that configured to allow outgoing requests?

stone23
Donor
Donor
Posts: 75
Joined: January 2023

Re: [3.3.0] Forum Subs

#54

Post by stone23 »

devspace wrote: 28 Mar 2023, 14:43
That is not normal at all - do you have a screenshot?
No, I didn't take a screenshot...

devspace wrote: 28 Mar 2023, 14:43
The only place where I would expect to see language keys is in the ACP log.
Sorry I made a mistake, it's true that the modules are no longer displayed when the extensions are disabled without deleting the data.

devspace wrote: 28 Mar 2023, 14:43
How about your firewall - is that configured to allow outgoing requests?
Yes since the extension worked with phpBB 3.3.9...
It's since the update to phpBB 3.3.10 that my problem came back...

stone23
Donor
Donor
Posts: 75
Joined: January 2023

Re: [3.3.0] Forum Subs

#55

Post by stone23 »

devspace wrote: 28 Mar 2023, 14:43
How about your firewall - is that configured to allow outgoing requests?
Are you talking about the php firewall?
Because I can't configure it...
I am creating a subdomain to create an online testing forum.

stone23
Donor
Donor
Posts: 75
Joined: January 2023

Re: [3.3.0] Forum Subs

#56

Post by stone23 »

devspace wrote: 28 Mar 2023, 14:43
How about your firewall - is that configured to allow outgoing requests?
I changed my php configuration and disabled the php firewall.
The pages are displayed but it is long and the version of the extension cannot be checked

ScreenShot036.jpg
You do not have the required permissions to view the files attached to this post.

Manard82
Donor
Donor
Posts: 2
Joined: May 2023

Re: [3.3.0] Forum Subs

#57

Post by Manard82 »

Hello,

In the management of groups and users, the name "ACP_USER_UTILS" has not been replaced by its the corresponding translation

Image

With my thanks for taking this replacement into account

Bernard

doublejay
Member
Member
Posts: 4
Joined: November 2023

Re: [3.3.0] Forum Subs

#58

Post by doublejay »

Using PHP 8.2, Postgresql 15 and phpBB 3.3.11, I get the following warning:
[phpBB Debug] PHP Warning: in file [ROOT]/ext/devspace/forumsubs/controller/main_controller.php on line 92: Undefined property: PgSql/Result::$num_rows
I guess it has something todo with changing the postgresql results from resource to objects in PHP 8.1:

https://php.watch/versions/8.1/PgSQL-resource

The offending line is:

Code: Select all

$num_rows = $result->num_rows;

User avatar
devspace
Owner
Owner
Posts: 280
Joined: October 2022

Re: [3.3.0] Forum Subs

#59

Post by devspace »

doublejay wrote: 05 Nov 2023, 14:58
Using PHP 8.2, Postgresql 15 and phpBB 3.3.11, I get the following warning:
[phpBB Debug] PHP Warning: in file [ROOT]/ext/devspace/forumsubs/controller/main_controller.php on line 92: Undefined property: PgSql/Result::$num_rows
I guess it has something todo with changing the postgresql results from resource to objects in PHP 8.1:

https://php.watch/versions/8.1/PgSQL-resource

The offending line is:

Code: Select all

$num_rows = $result->num_rows;
Can you try

Find // Get the member's subscriptions

Add before $num_rows = 0;

doublejay
Member
Member
Posts: 4
Joined: November 2023

Re: [3.3.0] Forum Subs

#60

Post by doublejay »

You mean replacing

Code: Select all

$num_rows = $result->num_rows;
with

Code: Select all

$num_rows = 0;
This will resolve the warning, but I don't know if this is the best solution.

If you really meant adding the line while keeping the offending line as-is, no, the warning is the same (because the offending line did not change).

doublejay
Member
Member
Posts: 4
Joined: November 2023

Re: [3.3.0] Forum Subs

#61

Post by doublejay »

So the problem is the extensions code is not DB agnostic.

If you use mySQL everything is fine, because mysqli_query will return a mysqli_result class. This class has a "num_rows" property:
https://www.php.net/manual/en/class.mysqli-result.php

But, if you use PostgreSQL as backend, pg_query is used by phpBBs DB driver, which returns a PgSql\Result class. This class has no "num_rows" property (it has no properties at all):
https://www.php.net/manual/en/class.pgsql-result.php

Thus, trying to access "num_rows" on a Postgres result will issue a Warning.

Edit: For Postgres, you would have to use pg_num_rows($result) instead of $result->num_rows. But of course then it will fail for everything that is not postgres.I don't know what the "phpBB way" of solving this is, but the root cause seems to be clear.

User avatar
devspace
Owner
Owner
Posts: 280
Joined: October 2022

Re: [3.3.0] Forum Subs

#62

Post by devspace »

Do you have this problem with PHP 8.1?

Whilst some/most of phpBB will work with PHP 8.2 the upper PHP version is still at 8.1

This may well be a bug in phpBB's dbal with PHP 8.2 and needs to be reported in phpBB's bug tracker.

doublejay
Member
Member
Posts: 4
Joined: November 2023

Re: [3.3.0] Forum Subs

#63

Post by doublejay »

No, it's because you are using code that only works with MySQL.

Please read my last post again. Accessing a "num_rows" property only works with MySQL. With PostgreSQL you get a completely different result class, one that has no such property.

Your code is not DB agnostic. It has nothing to do with PHP 8.2 or phpBB dbal.