Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

1-Liner: Allow registering new notice types #301

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
Loading
from

Conversation

MrSnoozles
Copy link
Contributor

@MrSnoozles MrSnoozles commented Sep 10, 2024

For a project of mine I wanted to use a NoticeSuccess type to show success-alerts on the frontend. This works as I would expect (create a child class of Notice and return 'success' in the getName() method), but a PHP Notice is thrown at the line I modified.
It warns that $this->_notices['success'] is undefined.

PHP Warning: Undefined array key "success" in [/var/www/html/wire/core/Wire.php:1244]

My proposed change would not alter the functionality but would get rid of the notice, as empty(), just like isset(), does not throw a warning when the key is undefined.

For a project of mine I wanted to use a `NoticeSuccess` type to show success-alerts on the frontend. This works as I would expect (create a child class of Notice and return 'success' in the getName() method), but a notice is throwing at this line, that `$this->_notices['success']` is undefined.

My proposed change would not alter the functionality but would get rid of the notice, as `empty()`, just like `isset()`, does not throw a warning when the key is undefined.
@MrSnoozles MrSnoozles changed the title Update Wire.php: Allow registering new notice types 1-Liner: Allow registering new notice types Sep 10, 2024
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.

1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.