MyBB Community Forums

Full Version: MyAlerts v2.0.4
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2016-02-12, 11:05 PM)MangaD Wrote: [ -> ]
(2016-02-12, 10:29 PM)Euan T Wrote: [ -> ]Hi,

What was the SQL error? Also, did you try checking the server error log for details about the 500 Internal Server Error? Changing the chmod shouldn't make any difference - this plugin doesn't use that file at all.

Forget the SQL 1064 error, I think that was on an outdated version I installed prior. Then I cloned from the git repository. And the error I got this time was (on local fresh install):
  • View Alerts | Delete Alerts:
    The following warnings occurred:
    Warning [2] Division by zero - Line: 354 - File: alerts.php PHP 5.6.11-1ubuntu3.1 (Linux)
    File Line Function
    /alerts.php 354 errorHandler->error
    /alerts.php 50 myalerts_view_alerts
  • Alert Settings - It is empty, there are no settings.
On the other forum I just got the 500 error, but I assume it is for the same reason, because it had the same solution. I changed the chmod of inc/settings.php to 666, uninstalled the plugin and installed again, the settings are there and no more warnings (so the problem is that the settings weren't set at the installation for some reason).

How you can reproduce this:
  • If you have the plugin installed or installed it before:
    • Uninstall the plugin;
    • Go to inc/settings.php and remove the lines concerning the MyAlerts settings.
  • chmod the file to 644
  • Install the plugin
  • Try to view the alerts or the settings...

Btw, after installing the plugin, the file can be set to 644 again, it will work fine.

Interesting.

The division by zero should be an easy fix, I'll sort that out. As for the settings being missing, can you check the mybb_alert_types table to see what it contains? Or do you mean the settings in the ACP?

When your settings.php is chmod 644, can you save any settings in the ACP at all? If not, then the chmod needs changing as I'd guess your web server is running in the same group as your user.
(2016-02-13, 10:19 AM)Euan T Wrote: [ -> ]As for the settings being missing, can you check the mybb_alert_types table to see what it contains? Or do you mean the settings in the ACP?

When your settings.php is chmod 644, can you save any settings in the ACP at all? If not, then the chmod needs changing as I'd guess your web server is running in the same group as your user.

The mybb_alert_types is empty. The settings in the ACP are there, but if I click Save it gives this error:
"The settings file "./inc/settings.php" isn't writable. Please CHMOD to 777.
For more information on CHMODing, see the MyBB Docs. "

This is how I found the fix. But it never happened with any other plugin...



I just managed to reproduce the SQL 1064 error I was having before, I changed the chmod to 664 and reinstalled the plugin. In this case the mybb_alert_types is not empty. I can access alerts.php?action=settings at the User CP. The error happens when viewing the alerts...
Also at the ACP I cannot save the settings for the same reason as above.

[attachment=35803]

But when I tried to reproduce this one a second time it didn't work, I just got the previous error where the settings are empty.

Edit: I guess the error is caused because of LIMIT 0 in that query...
(2016-02-13, 12:14 PM)MangaD Wrote: [ -> ]
(2016-02-13, 10:19 AM)Euan T Wrote: [ -> ]As for the settings being missing, can you check the mybb_alert_types table to see what it contains? Or do you mean the settings in the ACP?

When your settings.php is chmod 644, can you save any settings in the ACP at all? If not, then the chmod needs changing as I'd guess your web server is running in the same group as your user.

The mybb_alert_types is empty. The settings in the ACP are there, but if I click Save it gives this error:
"The settings file "./inc/settings.php" isn't writable. Please CHMOD to 777.
For more information on CHMODing, see the MyBB Docs. "

This is how I found the fix. But it never happened with any other plugin...



I just managed to reproduce the SQL 1064 error I was having before, I changed the chmod to 664 and reinstalled the plugin. In this case the mybb_alert_types is not empty. I can access alerts.php?action=settings at the User CP. The error happens when viewing the alerts...
Also at the ACP I cannot save the settings for the same reason as above.



But when I tried to reproduce this one a second time it didn't work, I just got the previous error where the settings are empty.

Edit: I guess the error is caused because of LIMIT 0 in that query...

Yes, not being able to save the settings shouldn't be limited to this plugin, but to all settings. This plugin doesn't do anything special with settings at all. The limit 0 SQL error could be caused by the settings - what's the setting for "alerts per page" in the ACP? If you want, you can PM me a URL and details for a temporary administrator account in order to take a look.
(2016-02-13, 02:06 PM)Euan T Wrote: [ -> ]The limit 0 SQL error could be caused by the settings - what's the setting for "alerts per page" in the ACP? If you want, you can PM me a URL and details for a temporary administrator account in order to take a look.

Sorry I cannot reproduce the SQL 1064 error. But the problem is definitely in the settings not being written. In fact you are right, the settings in general couldn't be written on the fresh local install.

But now in the remote forum (which was giving the 500 internal server error) I tried to chmod inc/settings.php to 644 and save MyAlerts settings, and it worked... So I wonder why I even had to chmod to 666 in the first place. I don't know how to see the logs here though.
Strange, it's definitely something related to the web server setup. is this a VPS or shared hosting? To view the logs, there may be an error.log file in the MyBB Root, or if you have cPanel there should be a section for error logs.
(2016-02-14, 10:28 AM)Euan T Wrote: [ -> ]Strange, it's definitely something related to the web server setup. is this a VPS or shared hosting? To view the logs, there may be an error.log file in the MyBB Root, or if you have cPanel there should be a section for error logs.

I believe it is shared hosting, but I am not in contact with the host. Also don't have access to cPanel and no error.log in the root. Well, it is working now anyway. Smile
@Euan T do you know how can I fix the MyAlerts Menu on User CP? Toungue
What theme are you using? Some themes use massively customised templates and/or styles which throw my default stylesheet off a bit. If you want, you can send me details for a temporary admin account to take a look (or a user account and I'll try work it out from inspect element).
Majestic. Ok, i will send you a PM.
I am also using Majestic, I just removed those images. Good thing would be adding fontawesome icons instead (just like Alert Setting buton has).

If you do code change relating to that, I also would like to have it.