Closed lwcorp closed 3 months ago
It shouldn't have failed a syntax check - Named Arguments (which I've used as it "allows skipping default values arbitrarily") have been supported since at least PHP 8.0.0, while phpList requires 8.1.
See:
I have just seen the comment about requiring php 8.1 or later. That is not a hard-requirement and I still know of people using php 7. Using named parameters is going to make the page unavailable in these cases.
The only reference in the code to a required version seems to be php 5.3.
if (version_compare(PHP_VERSION, '5.3.3', '<') && WARN_ABOUT_PHP_SETTINGS) {
Error(s('Your PHP version is out of date. phpList requires PHP version 5.3.3 or higher.'));
}
Yes, I wonder if we need to at least require 7.4 or something, but even 7.4 is EOL.
In fact, 8.0 is EOL
Fine, I've made it version dependent. Users who use EOL versions will get hardcoded default values. If those values ever change, only users with non EOL versions will automatically get the new default values.
I have just seen the comment about requiring php 8.1 or later. That is not a hard-requirement
So please fix the statement in that link to mention this.
There is a syntax error in the latest change.
But the original statement is not how pageLink2
() is intended to be called, although there are lots of instances of how that is done and maybe you copied one of those. The first parameter is the page name only, any further parameters for the URL should be in the $url
parameter
PageLink2('processbounces', s('Reprocess Only Existing Bounces'), 'justexisting=true', false, s('Reprocess Only Existing Bounces'))
thus having only one hard-coded parameter to pageLink2()
. There are many calls to PageLink2 that have to hard-code the third or fourth parameters in order to specify the $title
parameter, so one more should not really be a problem.
Having a version check with two alternate statements seems to be a worse solution as it has both the modern and old lines of code.
There is a syntax error in the latest change.
No, there wasn't, see discussion above - it's phpList's interpreter deciding to ignore v8+ commands even in v8+ mode. In any case, I don't know why would an old approach be better than a dual modern/old approach, but since it matters so much I've changed to just an old approach, thus no "syntax error" this time.
You can see function PageLink2's default values are blank for $url and false for $no_plugin. Since passing those values does no harm, I've kept them as such.
I think this can be merged into the next release.
This pull request has been mentioned on phpList Discuss. There might be relevant details there:
https://discuss.phplist.org/t/3-6-15-release-candidate-is-available-for-testing/9473/1
This pull request has been mentioned on phpList Discuss. There might be relevant details there:
https://discuss.phplist.org/t/phplist-3-6-15-has-been-released/9495/1
Description
Screenshots (if appropriate):