Closed KeteTheme closed 2 years ago
Update: OK if we go to our site/alert.php it will still give an error: Notice: Undefined index: action in
Hi,
Are you using the version of MyAlerts that used to be on the MyBB mods site? If so, it's not up to date with the code here in GitHub. I'd advise updating to the code from GitHub which will need a deactivate and reactivate and a check of the templates.
On Wed, 16 Mar 2022, at 02:31, KeteTheme wrote:
Update: OK if we go to our site/alert.php it will still give an error: Notice: Undefined index: action in
— Reply to this email directly, view it on GitHub https://github.com/MyBBStuff/MyAlerts/issues/275#issuecomment-1068668782, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFW24N6VWLSOCAWM2BMYVTVAFBYPANCNFSM5Q2PQIEQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>
I have used the plugin downloaded directly from github.
Ah, I've read the issue further now. It looks like this is a notice, rather than a warning or anything. Notices can usually be ignored in PHP, but the fix is actually rather simple - change this code: https://github.com/MyBBStuff/MyAlerts/blob/master/alerts.php#L11:L13
to:
if (isset($_GET['action']) && $_GET['action'] == 'modal') {
defined('NO_ONLINE') or define('NO_ONLINE', 1);
}
I'll create a patch for this now.
MyBB: 1.8.29. PHP: 7.2.12
There is a problem when viewing the alert modal (PHP). Notice: Undefined index: action in C:\xamp\xampp7\htdocs\Mybb\alerts.php on line 11
if ($_GET['action'] == 'modal') { defined('NO_ONLINE') or define('NO_ONLINE', 1); }
I have this problem, but due to my basic PHP experience I was able to find the problem, calling "action" in html gives error. since we call alert.php?modal=
onclick="MyBB.popupWindow('/alerts.php?modal=1&ret_link={$myalerts_return_link}', { fadeDuration: 250, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }); return false;"
one of the solutions I had was to modify the onclick or just modify the GET.
if ($_GET['**modal**'] == 'modal') { defined('NO_ONLINE') or define('NO_ONLINE', 1); }
OR
onclick="MyBB.popupWindow('/alerts.php?action=modal&ret_link={$myalerts_return_link}'); return false;"
I would like the author to get a better solution or simply indicate if what I am doing is correct. Thank you and happy days!