User tests: Successful: Unsuccessful:
Pull Request for Issue #29696 .
A very light touch change to reuse existing code to display a warning and remove the ability to add authenticators if the PHP extension GMP is not loaded.
Install Joomla 4 on a server (or docker container in my case) without GMP PHP Extension enabled (On a cPanel server you can toggle this, and its off by default in Easy Apache 4)
Ensure you access Joomla over a secure & valid SSL connection (learn ngrok if you need this, quick and easy)
When adding an authenticator you get an internal server error
You get a error and no button allowing you to add a new authenticator (but you can still see the list of existing authenticators - if any - rename them, and delete them.)
// @nikosdion
Status | New | ⇒ | Pending |
Category | ⇒ | Administration Language & Strings Layout |
ah well... "Expected" and "Actual" are very unhelpful terms anyway. "Before" and "After" are more suited to PRs IMHO. Edited :)
ah well... "Expected" and "Actual" are very unhelpful terms anyway. "Before" and "After" are more suited to PRs IMHO.
Agree .. it's often subject of confusion.
I'd actually change the detection code to use function_exists()
with some GMP function names for two reasons.
First, I've seen many hosts where get_loaded_extensions
itself is disabled, making that kind of code fail immediately with a fatal error. I know, these hosts are crap but they are used by people using Joomla...
Second, it's possible that the extension is enabled but the host disabled the functions. I have not seen that with GMP but I can't rule out outright stupidity when it comes to cheap hosting.
Thanks - I'll get that done.
Labels |
Added:
?
?
|
Ive gone for
if (false === function_exists('gmp_intval'))
because gmp_intval
was the first function called by the code which caused the Internal Server Error.
(Subject to passing code style haha)
@PhilETaylor Normally we do it the other way round, i.e. if (function_exists('gmp_intval') === false)
and not if (false === function_exists('gmp_intval'))
. But I'm ok with it if that passes PHPCS.
lol I knew someone was either going to say that or ask why I did not just use a
if (!function_exists('gmp_intval'))
There are 333 examples of doing it my way in Joomla 4 (admittedly only 5 are in Joomla code outside of vendor ;))
There is a good reason to do it - although I cannot find some article to link to, here is the gist:
// using this:
if (false == $var)
// its impossible to this by mistake
if (false = $var)
// because a PHP error would happen
// whereas if you flipped and did it the other way
if ($var == false)
//then its VERY easy to make a typo and get:
if ($var = false)
// which would ALWAYS be true and PHP would not error to alert you....
found a link (12 years ago haha) https://www.php.net/manual/en/control-structures.if.php#81698
@PhilETaylor PHPCS is ok with it, so I am, too. Unfortunately I can't help with testing, because my local testing environment uses a self signed SSL certificate, and I haven't set up any webauthentication for me anywhere. And testing space on my domain which has a valid SSL cert is protected with password, so I am not sure if it would work there.
@richard67 You need to learn https://ngrok.com then :) Install that, and then at your command line type
ngrok http 80
Where 80
is the port number of your local Joomla install
Then you will be given a SSL url like: https://RANDOM.ngrok.io
When you go to that url it proxies to your local install and gives you a valid SSL connection :)
@PhilETaylor You can't teach an old dog new tricks ;-)
(have to go back to my vi editor)
Not much to learn :)
brew cask install ngrok
ngrok http 80
Done. :-)
All checks have passed
All checks have passed
? ?
There must be something wrong ... ;-)
I have tested this item
Thank you for the ngrok info. So simple!!!
Self hosted alternative to Ngrok written in PHP: https://pociot.dev/28-introducing-expose-an-easy-to-use-tunneling-service-implemented-in-pure-php#introducing-expose-an-easy-to-use-tunneling-service-implemented-in-pure-php
Apparently it took the PHP world by storm over the last couple of weeks.
Just needs one more human test (if you have time please) to get to RTC.
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-07-20 19:35:19 |
Closed_By | ⇒ | richard67 | |
Labels |
Added:
?
|
Thanks!
@PhilETaylor Maybe some general explanation about or PR descriptions: "Expected result" always shall describe what one expects, i.e. how it is with the PR applied, "Actual result" shall describe what one currently observes, i.e. how it is without the PR applied. Your description above currently mixes that up.