You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which operating systems have you tested for this bug?
Linux
Which server did you use?
apache
Database
MySQL 8.0.39
Did you customize Shield?
No
What happened?
In an attempt to create an email_helper and override the emailer function the system produces an error trying to redefine that function because the verification of a previously defined function of identical name is done using defined instead of function_exists.
Steps to Reproduce
Copy codeigniter4/shield/src/email_helper.php into app/Helpers
Expected Output
No error when overriding the emailer function
Anything else?
No response
The text was updated successfully, but these errors were encountered:
@FrancoisChaumont , Thank you for bringing this issue to our attention!
If you’re able to, we would encourage you to submit a Pull Request (PR) to address this issue. It would be great if you could refactor the code to use function_exists() instead of defined(), which will help prevent errors related to function redefinitions. Also, please make sure your GPG key is configured on your GitHub account before submitting the PR, as it is required for signature verification.
Additionally, could you please provide more details on why you need to override the helper function?
datamweb
changed the title
Bug: defined used for function
Bug: defined() used for function
Aug 19, 2024
Hey @datamweb, Thanks for taking the time to get back to me about this.
Sure thing, I'll submit a PR in a little bit.
Overriding the helper was considered as an intent to white-label an existing solution (especially config values) but it turns out (after some head banging against the wall) that it's even necessary.
PHP Version
8.3
CodeIgniter4 Version
4.5.4
Shield Version
dev-develop 223fbd9
Which operating systems have you tested for this bug?
Linux
Which server did you use?
apache
Database
MySQL 8.0.39
Did you customize Shield?
No
What happened?
In an attempt to create an
email_helper
and override theemailer
function the system produces an error trying to redefine that function because the verification of a previously defined function of identical name is done usingdefined
instead offunction_exists
.Steps to Reproduce
Copy codeigniter4/shield/src/email_helper.php into app/Helpers
Expected Output
No error when overriding the
emailer
functionAnything else?
No response
The text was updated successfully, but these errors were encountered: