Fixed Album access lost after merging user


Well-known member
Affected version
Steps to reproduce
  1. Create an album and set Can view media items = Specific memberss: User A
  2. Merge User A with User B
  3. Edit the Album
Expected Result
User B is being shown as an allowed user

Actual Result
No User is being shown. When trying to Add User B a database error does happen
XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry '5-11' for key 'PRIMARY' src/XF/Db/AbstractStatement.php:228
Generated by: kirby Apr 24, 2020 at 8:46 AM
Stack trace
INSERT  INTO `xf_mg_shared_map_view` (`album_id`, `user_id`) VALUES (?, ?)

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException()
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException()
#2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(218): XF\Db\AbstractAdapter->query()
#4 src/XF/Mvc/Entity/Entity.php(1463): XF\Db\AbstractAdapter->insert()
#5 src/XF/Mvc/Entity/Entity.php(1195): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/addons/XFMG/Service/Album/SharedUserManager.php(104): XF\Mvc\Entity\Entity->save()
#7 src/addons/XFMG/Service/Album/Editor.php(120): XFMG\Service\Album\SharedUserManager->saveSharedUsers()
#8 src/XF/Service/ValidateAndSavableTrait.php(40): XFMG\Service\Album\Editor->_save()
#9 src/addons/XFMG/Pub/Controller/Album.php(414): XFMG\Service\Album\Editor->save()
#10 src/XF/Mvc/Dispatcher.php(350): XFMG\Pub\Controller\Album->actionEdit()
#11 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass()
#12 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch()
#13 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop()
#14 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
#15 src/XF.php(391): XF\App->run()
#16 index.php(20): XF::runApp()
#17 {main}
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XFMG release (2.2.5).

Change log:
Rebuild album privacy caches when merging users
There may be a delay before changes are rolled out to the XenForo Community.
Top Bottom