Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

'Add Message' not working (server is IIS) (MySQL Strict Mode)

edited March 2012 in Vanilla 2.0 - 2.8

The first time I installed, it worked for the first message. I tried to add another message and the screen would just stay on the 'Add Message' popup and the animation would run forever next to the save button. This was running on IIS 7 + php and mysql.

I installed XAMP and reinstalled everything with new database etc.. it did the same thing. Then I reinstalled everything (new database) on IIS again and now its not even letting me add my first message. Everything else works (Except for changing permissions on already existing categories - but thats not a big deal)

I see calls to /dashboard/notifications/inform every few seconds?!?

Please help or let me know what goes into the gdn_message table for Format, Application, Controller, Method, AssetTarget columns so I can manually add messages!

I am not sure where to start - this is from IIS log:

<

pre>2012-03-20 20:29:13 174.142.94.185 GET /index.php p=/dashboard/message/add&DeliveryType=VIEW 80 - 174.142.94.185 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.0;+WOW64;+Trident/4.0;+SLCC1;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E;+.NET+CLR+1.1.4322) 200 0 0 93

2012-03-20 20:29:26 174.142.94.185 POST /index.php p=/dashboard/message/add&DeliveryType=VIEW 80 - 174.142.94.185 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.0;+WOW64;+Trident/4.0;+SLCC1;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E;+.NET+CLR+1.1.4322) 256 0 0 109
2012-03-20 20:29:26 174.142.94.185 POST /index.php p=/dashboard/notifications/inform 80 - 205.141.66.16 Mozilla/5.0+(Windows+NT+5.1)+AppleWebKit/535.11+(KHTML,+like+Gecko)+Chrome/17.0.963.79+Safari/535.11 200 0 0 234
2012-03-20 20:30:12 174.142.94.185 POST /index.php p=/dashboard/notifications/inform 80 - 174.142.94.185 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.0;+WOW64;+Trident/4.0;+SLCC1;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E;+.NET+CLR+1.1.4322) 200 0 0 78
2012-03-20 20:30:27 174.142.94.185 POST /index.php p=/dashboard/notifications/inform 80 - 205.141.66.16 Mozilla/5.0+(Windows+NT+5.1)+AppleWebKit/535.11+(KHTML,+like+Gecko)+Chrome/17.0.963.79+Safari/535.11 200 0 0 218
2012-03-20 20:31:13 174.142.94.185 POST /index.php p=/dashboard/notifications/inform 80 - 174.142.94.185 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.0;+WOW64;+Trident/4.0;+SLCC1;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E;+.NET+CLR+1.1.4322) 200 0 0 93
2012-03-20 20:31:27 174.142.94.185 POST /index.php p=/dashboard/notifications/inform 80 - 205.141.66.16 Mozilla/5.0+(Windows+NT+5.1)+AppleWebKit/535.11+(KHTML,+like+Gecko)+Chrome/17.0.963.79+Safari/535.11 200 0 0 249
2012-03-20 20:32:13 174.142.94.185 POST /index.php p=/dashboard/notifications/inform 80 - 174.142.94.185 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.0;+WOW64;+Trident/4.0;+SLCC1;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E;+.NET+CLR+1.1.4322) 200 0 0 109
2012-03-20 20:32:27 174.142.94.185 POST /index.php p=/dashboard/notifications/inform 80 - 205.141.66.16 Mozilla/5.0+(Windows+NT+5.1)+AppleWebKit/535.11+(KHTML,+like+Gecko)+Chrome/17.0.963.79+Safari/535.11 200 0 0 280

Best Answer

  • x00x00 MVP
    Answer ✓

    basically you have to turn off strict mode mysql if you can. Vanilla was not built with strict mode in mind. They will slowly get to that, but there are a million other issues that have higher priority.

    grep is your friend.

Answers

  • Explain what you mean with adding a "message". Where?

    Maybe a notice at the top of the screen like we do here when we announce that a new version is available?

    Whenever the animation is running forever, assume that an ajax call isn't working properly. Also assume that some people get notified of that new message, therefore the call to /dashboard/notifications/inform

    Whenever an ajax call isn't working properly, look in the FireBug logs, to see if you can figure out what's going wrong.

    Can't help you in the IIS department. Good thing that you can install Xampp if needed.

    There was an error rendering this rich post.

  • Yes, it is the 'announce' message that you add from the dashboard:
    Appearance->Messages->Add Message

    I had the same issue when I tried vanilla with XAMP.

    OK I looked at the 'Network' under google chrome console (Ctrl+Shift+J in google chrome) and this is what I got:
    Exception: "Incorrect integer value: '' for column 'AllowDismiss' at row 1|Gdn_Database|Query|insert GDN_Message ↵(Content, AllowDismiss, Enabled, Controller, AssetTarget, CssClass)

    So basically, and this is a little stupid of me for not trying this option, but if I add a message with 'Allow users to dismiss' then I am able to add the message.

    I think when the 'Allow Dismiss' option is not checked a value of '0' should be passed but in my case it is passing a blank value. Or at least thats what I think is happening - any quick fixes?

    I can always change is manually in the database.

  • Oh also I can not save a message if I dont check 'Enable this message'

  • x00x00 MVP
    Answer ✓

    basically you have to turn off strict mode mysql if you can. Vanilla was not built with strict mode in mind. They will slowly get to that, but there are a million other issues that have higher priority.

    grep is your friend.

  • x00x00 MVP
    edited March 2012

    try this (not tested)

    $Configuration['Database']['ConnectionOptions'] = array(
       12 => FALSE, //PDO::ATTR_PERSISTENT => FALSE,
       1000 => TRUE, // PDO::MYSQL_ATTR_USE_BUFFERED_QUERY is missing in some php installations
       1002 => "set names 'utf8', SQL_MODE='TRADITIONAL'" // PDO::MYSQL_ATTR_INIT_COMMAND is missing in PHP 5.3, so I use the actual value "1002" instead
    );

    grep is your friend.

  • looking at git hub issue they are slowly making strict mode commutable. Please report the issue to help out:

    https://github.com/vanillaforums/Garden/issues

    like I said it is not a high priority.

    grep is your friend.

  • edited March 2012

    Thanks for pointing me in the right direction!!

    I ran this on mysql and it fixed the issue:

    @global.sql_mode= '';

    Supposedly it disables the strict mode on mysql.

    I know its not a high priority issue and this is not the best fix but it works for me.

    Thanks!

Sign In or Register to comment.