Project

General

Profile

Actions

Bug #7998

closed

Fields: field values do not get removed on plan deactivation if a usergroup has been assigned

Added by krileon over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
06 May 2020
Due date:
% Done:

100%

Estimated time:

Description

If a plan assigns a usergroup and the plan is configured to set a field value, but also configured to remove the field value on plan deactivation then removal of the field value fails. This is only the case if the plan is assigning a usergroup. More than likely the double ->store() (1 for the field value change and 1 for the usergroup change) is the cause.

https://www.joomlapolis.com/forum/277-cb-paid-subscriptions-support/242463-share-plan-with-cb-fields-integration-not-removing-value-on-plan-deactivativatio#318296

Actions #1

Updated by krileon over 2 years ago

checkUserSubscriptions calls _adjustUserAclBlock to change ACL and block state. It is not sent a reference user object. It also does not cause a new UserTable() with ->load call to reload the user object. This means any changes made to a user object during integrations will be lost when the ACL and block state changes happen. It is using getUserDataInstance though, which does cache user objects for reuse so as long as the entire chain is using a user object from that cache it should work as expected.

Actions #2

Updated by krileon over 2 years ago

Confirmed issue.

Actions #3

Updated by krileon over 2 years ago

Issue is entirely in CBSubs Fields integration. The _addField and _removeField functions do not expect reference user objects and the _removeField function is not correctly setting the reverted value into the user object.

Actions #4

Updated by krileon over 2 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Fixed in MR !190

Actions #5

Updated by beat over 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF