News:

SMF 2.1.2 has been released! Take it for a spin! Read more.

Main Menu

@mention members

Started by Dragooon, May 02, 2014, 01:07:58 PM

Previous topic - Next topic

Sebastiii

Hello :)
After upgrading from 2.0.18 to 2.0.19 :)
When going to "Profil -> Mentions" section to see all mentions tag, when unchecking the "E-mail mention notifications" checkbox, I'm getting :
Incorrect integer value: '' for column 'email_mentions' at row 1
File: ...\Sources\Subs.php
Line: 542

Everything was good in 2.0.18, is there a change in DB post that trigger this issue after going to 2.0.19 ?
Thanks.

Arantor

@Sebastiii this is a known bug in the mod.

Quote from: Shambles on December 04, 2019, 02:34:33 PMUnder PHP 7.1, when unchecking Profile > Profile Info > Mentions > E-mail mention notifications:





The (bool) cast within Mentions.php is no longer returning 0 when false; it's returning null, causing the above error.

Solution:

Sources/Mentions.php

Code (Find) Select
if (!empty($_POST['save']) && $user_info['id'] == $memID)
updateMemberData($memID, array('email_mentions' => (bool) !empty($_POST['email_mentions'])));

Code (Replace) Select
if (!empty($_POST['save']) && $user_info['id'] == $memID)
updateMemberData($memID, array('email_mentions' => empty($_POST['email_mentions']) ? 0 : 1));
Perhaps it would have been better if I'd simply never bothered. Y'all clearly would be less unhappy that way.

Sebastiii

Hi @Arantor
This is great :)
Thanks a lot


Advertisement: