After you created a new privacy group you can add already added members again, which results in a "database error". Same happens if you later add all to the group.
Error Email send by dolphin:
Query: INSERT INTO `sys_privacy_members` SET `group_id`='33', `member_id`='3' Mysql error: Duplicate entry '33-3' for key 'group_member'
Found error in the file '/www/htdoc/inc/classes/BxDolPrivacyQuery.php' at line 163. Called 'query' function with erroneous argument #0.
.......
Is it possible to filter already added members out of the list so this cannot happen anymore? Any other workaround?
Thanks in advance
Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81 |
The exact error message
Error
Database query error
I can see the problem in the code because there is no check if the user already exists. Before i apply some kind of silly quick fix i really would like to know if it can be done in some calls before. So it's a really clean solution.
Currently i use the ON DUPLICATE KEY UPDATE statement to workaround the error on line 163. I would be happy if Boonex could provide a real fix for it, so the user not even gets displayed in the add list if already added to this group.
$iCount += $this->query("INSERT INTO `sys_privacy_members` SET `group_id`='" . $iGroupId . "', `member_id`='" . (int)$iMemberId . "' ON DUPLICATE KEY UPDATE `group_id` = `group_id`, `member_id` = `member_id`");
Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81 |
Thank you for the report:
I would suggest to make the following modification:
$iCount += $this->query("INSERT IGNORE INTO `sys_privacy_members` SET....
Rules → http://www.boonex.com/terms |
Thanks Alex,
do i also have to make the other two changes for the files
templates/base/adminActionsPanel.html
templates/base/scripts/BxBasePrivacyView.php
which are mentioned in the ticket or is this only for 7.1?
Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81 |
Yes, it is better to apply all changes from the changeset.
Thanks Alex,
do i also have to make the other two changes for the files
templates/base/adminActionsPanel.html
templates/base/scripts/BxBasePrivacyView.php
which are mentioned in the ticket or is this only for 7.1?
Rules → http://www.boonex.com/terms |
I asked because the code lines in templates/base/adminActionsPanel.html look so different. So i am not sure if i can just change it there. I guess i have to leave this button_wrapper construction
7.0.9
<div class="input_wrapper input_wrapper_submit"> <div class="button_wrapper"><input class="form_input_submit" type="{type}" name="{name}" value="{value}" {onclick} /> <div class="button_wrapper_close"></div> </div>
7.1.0
<button class="bx-btn bx-btn-small" type="{type}" name="{name}" value="{value}" {onclick} >{value}</button
As you can see the value="{value}" is already in 7.0.9. But where to put this {value} from 7.1.0 which is encapsulated by this new button class ? Right before <div class="button_wrapper_close"> or is this something specific to 7.1.0?
Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81 |
Sorry, this change should be omitted for 7.0.9.
I asked because the code lines in templates/base/adminActionsPanel.html look so different. So i am not sure if i can just change it there. I guess i have to leave this button_wrapper construction
7.0.9
<div class="input_wrapper input_wrapper_submit"> <div class="button_wrapper"><input class="form_input_submit" type="{type}" name="{name}" value="{value}" {onclick} /> <div class="button_wrapper_close"></div> </div>
7.1.0
<button class="bx-btn bx-btn-small" type="{type}" name="{name}" value="{value}" {onclick} >{value}</button
As you can see the value="{value}" is already in 7.0.9. But where to put this {value} from 7.1.0 which is encapsulated by this new button class ? Right before <div class="button_wrapper_close"> or is this something specific to 7.1.0?
Rules → http://www.boonex.com/terms |