Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted March 3, 20223 yr During the upgrade to version 4.6.10 the file... /system/Member/Member.php line 415 ... was updated with a change of logic to detect if the "memberSync" hook should be called. Our extension relies on calls to this hook and we noticed after this upgrade that data stopped coming through. I believe the change in logic at this time was intended to stop updates when only the "last_activity" field had changed and nothing else, however the logic used now fails on ANY data with more than 1 value in the $changes array. As a proof of concept I took the existing logic and tested it (this returns false, when it should return true) $changedCustomFields = []; $changes = [ 'a'=>1, 'b'=>1 ]; $res = ( \count( $changedCustomFields ) > 0 OR ( \count( $changes ) > 0 AND ( \count( $changes ) === 1 AND !isset( $changes['last_activity'] ) ) ) ); var_dump($res); // false I think the following logic should work instead... <?php $changedCustomFields = []; $changes = [ 'a' => 1, 'b' => 1 ]; $res = ( \count( $changedCustomFields ) > 0 OR ( \count( $changes ) > 0 AND !( \count( $changes ) === 1 AND isset( $changes['last_activity'] ) ) ) ); var_dump($res); // true
March 4, 20223 yr Community Expert I have flagged this for a developers attention, so they can review this. It may well have been an intentional change
March 16, 20223 yr 3 hours ago, Convergent Trading said: @Daniel F Thanks, did you come to the same conclusion? Yes, thanks for the report. The fix is currently awaiting review and approval 🙂