We have a problem that may have started after upgrading from 4.4.11 to 4.4.19 on Drupal - anyway, it's started happening fairly recently.
We have public page that allows for a membership contribution for an individual to register/sign up and create an organisation at the same time (Employer of). Normally there's a contribution in the Organisation and a membership record in the organisation - and a membership by relationship for the individual.
The problem is that the individual membership record is not being created now. (It can be fixed up by admin to create the relevant record).
I've been tracing the code and I think it is a relationship permission problem. If I remove a permission check in CRM_Contact_BAO_Relationship::getRelationship() then the right record is created. However this doesn't seem like a good fix for the problem.
Can anyone think of a change to permissions or onbehalfof around this time which might have this effect.
We do have some custom code in this area - which adds permission is_permission_b_a in CRM_Contribute_Form_Contribution_Confirm::processOnBehalfOrganization() - I think I've tried removing that .