Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] I fixed a PHP Warning added a condition to check if ->get('rec… #1128

Conversation

amaninyumu1
Copy link
Member

No description provided.

@marclaporte marclaporte requested a review from Shadow243 August 1, 2024 15:00
@Shadow243
Copy link
Member

@amaninyumu1 Can you describe the scenario please !

@amaninyumu1
Copy link
Member Author

Hello @Shadow243.

@amaninyumu1
Copy link
Member Author

amaninyumu1 commented Aug 2, 2024

Hello @Shadow243
The problem was that we were trying to use $this->get('recaptcha_config') without being able to check if it exists. So I added a condition to check if it exists and then use it

Copy link
Member

@Shadow243 Shadow243 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://github.com/cypht-org/cypht/blob/master/modules/recaptcha/setup.php#L8 $this->get('recaptcha_config') will never be undefined, did you get an issue about it ?

The file https://github.com/cypht-org/cypht/blob/master/modules/recaptcha/recaptcha.ini should be removed as well.

@amaninyumu1
Copy link
Member Author

Yes but in this scenario the error was that the "recaptcha_config" key is null so it was impossible to access array offset on value of type null which is why I checked if it exists. In case it exists then it is not null

@Shadow243
Copy link
Member

The file https://github.com/cypht-org/cypht/blob/master/modules/recaptcha/recaptcha.ini should be removed as well.

Remove this please

@amaninyumu1 amaninyumu1 force-pushed the trying-to-access-array-offset-on-value-of-type-null branch from 4b21dc9 to d6ae005 Compare August 3, 2024 08:07
@amaninyumu1
Copy link
Member Author

@Shadow243
Copy link
Member

I just added the same condition at the recaptcha script level to prevent the js file from being reloaded: https://www.google.com/recaptcha/api.js when we don't need it.

You can test to see if there will be an error (in console and in logs)

@amaninyumu1
Copy link
Member Author

yes it works

@Shadow243 Shadow243 merged commit d7b1b72 into cypht-org:master Aug 3, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants