MyBBStuff / MyAlerts

A simple notification/alert system for MyBB similar to IPB and XenForo's core implementations of user notifications.
http://www.euantor.com/myalerts/
47 stars 33 forks source link

Big error when I reply in a thread #108

Open debby1 opened 9 years ago

debby1 commented 9 years ago

Hi, I have installed the latest plugin for 1.8: https://github.com/MyBBStuff/MyAlerts/tree/develop

But when I go to send a reply in my forum I have error:

http://i.imgur.com/4mBz708.png

and reply doesn't is showed. If I try with quick reply only spinner image and no reply.

How can I resolve? Thanks

euantorano commented 9 years ago

Strange. Is this using full reply or quick reply and are you running any other plugins that affect reples?

On 4 Jan 2015, at 19:29, debby1 notifications@github.com wrote:

Hi, I have installed the latest plugin for 1.8: https://github.com/MyBBStuff/MyAlerts/tree/develop

But when I go to send a reply in my forum I have error:

http://i.imgur.com/4mBz708.png

How can I resolve? Thanks

— Reply to this email directly or view it on GitHub.

debby1 commented 9 years ago

Hi, I used myalerts for 1.8 some day ago and I hadn't problems, then I uninstalled and reinstalled it for new pagination in option page.

Maybe I have to clean also in database?

I have uninstalled again Myalerts and now replies work again :(

Can you tell me if there are tables in database to delete about MyAlerts? So I clean all and I try to reinstall

euantorano commented 9 years ago

Hi, simply running the "uninstall" should remove all of the tables. If there are any left, they'll be called something similar to "my_alert_settings" etc. There should be 3 or 4 tables with "alert" in the name.

debby1 commented 9 years ago

Nothing, it doesn't work.

I have deactivated and uninstalled plugin. I have re-uploaded all files from developed version (2.0.0) and activated. I'm on 1.8.3, PHP version 5.6.4.

When I try to reply in a thread:

Error Type: Catchable Fatal Error (4096)

Error Message: Argument 1 passed to MybbStuff_MyAlerts_AlertManager::doUsersWantAlert() must be an instance of MybbStuff_MyAlerts_Entity_AlertType, null given, called in /(my-site-name-and-link)/public/forum/inc/plugins/MybbStuff/MyAlerts/src/AlertManager.php on line 155 and defined

Location: File: inc/plugins/MybbStuff/MyAlerts/src/AlertManager.php

Line: 521 Code:

  1. * @return array
  2. */
  3. public function doUsersWantAlert(
  4. MybbStuff_MyAlerts_Entity_AlertType $alertType,
  5. array $users = array(),
  6. $findUsersBy = self::FIND_USERS_BY_UID
  7. ) {

I have checked in alertManager.php but I don't find where's the problem..

In database I don't find other tables about MyAlerts.When I uninstall the plugin, also tables mybb_alerts and mybb_alert_types are cancelled.

euantorano commented 9 years ago

Odd, I'll look into it. Thanks for the report!

On 4 Jan 2015, at 21:17, debby1 notifications@github.com wrote:

Nothing, it doesn't work.

I have deactivated and uninstalled plugin. I have re-uploaded all files from developed version (2.0.0) and activated. I'm on 1.8.3, PHP version 5.6.4.

When I try to reply in a thread:

if using quickreply: I write quickreply, I send it but reply is blocked, there's always the "spinner" image in loading. If I refresh page there isn't my reply but in Alerts I see there's an alert about this reply. I click on alert but reply there isn't...a ghost reply :-(

if using new reply (full reply): I write reply, I send it and error:

Error Type: Catchable Fatal Error (4096)

Error Message: Argument 1 passed to MybbStuff_MyAlerts_AlertManager::doUsersWantAlert() must be an instance of MybbStuff_MyAlerts_Entity_AlertType, null given, called in /(my-site-name-and-link)/public/forum/inc/plugins/MybbStuff/MyAlerts/src/AlertManager.php on line 155 and defined

Location: File: inc/plugins/MybbStuff/MyAlerts/src/AlertManager.php

Line: 521 Code:

  1. * @return array
  2. */
  3. public function doUsersWantAlert(
  4. MybbStuff_MyAlerts_Entity_AlertType $alertType,
  5. array $users = array(),
  6. $findUsersBy = self::FIND_USERS_BY_UID
  7. ) {

I have checked in alertManager.php but I don't find where's the problem..

In database I don't find other tablet about MyAlerts.When I uninstall the plugin, also tables mybb_alerts and mybb_alert_types are cancelled.

— Reply to this email directly or view it on GitHub.

debby1 commented 9 years ago

You try if can to uninstall and reinstall the plugin. Now I test this on my other test forum.

debby1 commented 9 years ago

On test forum I had other version of myalerts develop, reinstalled the latest version, activated and all works, also replies. So, it's a problem specific with my forum / database.. :-( Maybe there's some problem of jquery. I use also ThankYou/Like System v1.5 with MyBB 1.8.

In console of Chrome, when I send a reply, I get these errors:

http://i.imgur.com/7rrD8et.png

I use also advanced quick reply: http://community.mybb.com/thread-158367.html (but I have fatal error also with full newreply) and imgur upload button.

Neurovert commented 8 years ago

I have the same issue which appears only when ThankYou/Like System is installed. Ajax gets screwed up. Can't find anny errors in logs or in browser developer console.

euantorano commented 8 years ago

Strange, I thought that ThankYou/Like was meant to be compatible, but it must be doing something strange. I'll see if I can get it and MyBB installed to test with.

Neurovert commented 8 years ago

@euantorano MyAlerts and TYL code is perfectly fine. It's all language file related. I've checked it on a remote server on which error.log works and I had errors from langfiles. Don't know yet if it was related to wrong coding (ASCII insted of UTF-8) or some semicolon stuff or maybe different. I will let you know so that other people may troubleshoot. I'm retranslating the original langfiles now, to make sure if it was simple human mistake.

Neurovert commented 8 years ago

OK I've checked this with all possible error messages from PHP SQL etc enabled and I found this:

session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/vhosts/40/146742/webspace/httpdocs/debug/inc/languages/polish/thankyoulike.lang.php:1)

Path:

File: inc/plugins/invite.php
Line: 342

I had few errors like this all leading to this 342th line in invite.php which is: session_start();

Solution is in language and plugin file coding: Never save php files with UTF-8 with BOM. Use UTF-8 WITHOUT BOM. It will fix the problem. BOM adds empty bits before the <?php part and that causes issues.

I think this is also a solution to @debby1 problem.

I myself converted all php files on my server to UTF-8 without BOM, just to be sure.

Lesson learned.