Answers.Body: <p>The most basic answer to this question was as PeteDNZ suggested, a matter of permissions on the relationship.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-13T20:53:26.853Z
Answers.LastActivityDate: 2023-12-13T20:53:26.853Z
Answers.UserDisplayName: kapn
Body: <p>I am helping a small org get through a membership renewal campaign again this year that has  organizational memberships. A report from a user about an error sent me looking to understand what was happening.</p>
  <p>To test, I created some fake users and gave them employers as well. So in each case there is an individual and related organizational contact. I have a contribution page that is set to &quot;on behalf of&quot;. The page loads. It can be completed and submitted. However when entered with a URL like &quot;https://sitename.org/civicrm/contribute/transact/?reset=1&amp;id=21&amp;cs=c7796dee0e6d34a976aa8a8a7ea7c25b_1702432880_168&amp;cid=33557&quot;, the header shows the contact's name, the regular name and email profile at the bottom of the page is filled, but the &quot;on behalf of&quot; reserved profile is blank. I swear this worked last year.</p>
  <p>I tested this for multiple users with the same result. Interestingly, when I test for my own user, I get the &quot;Membership Organization&quot; values in the &quot;on behalf of&quot; profile. That is, it shows the org I am joining as a member, not the one I &quot;work for&quot;. Not really what is intended.</p>
  <p>I also tested another site and got the same result of blank &quot;on behalf of&quot; profiles. If I had not used this in previous years I would just assume this function doesn't work, but I'm sure this worked last year.</p>
  <p>I'm hoping someone can shed light on this situation or offer thoughts for troubleshooting. Unfortunately, the situation has become somewhat urgent as I didn't catch this before the mailing went out. We'll need to follow up, but I would really like to have something useful to say.</p>
  <p>There are no entries of any kind in the Civi or Apache error logs. I'm running 5.68.0 on WordPress 6.4.2 and PHP 8.2.13</p>
  <p>UPDATE: Expanding my test set reveals a couple of older contacts where it works. However, looking at their relationships tab and employer field reveal that these contacts don't show their employer relationship on the relationships page. If I try to add it, I get a duplicate error. If I remove their employer, I can add them on the relationships page. However, the employer field does not visibly populate on the summary tab. If I click in to edit, it shows it filled after all, but when I click save to get out to view, it vanishes.
  Further, once I have removed and re-added the employer/employee relationship in this manner the &quot;on behalf of&quot; form is blank for this contact now too.</p>
  <p>I'm wondering if some sort of relationship bug may have been introduced as the interface has started to incorporate SearchKit and FormBuilder interface elements? I am absolutely baffled.</p>
  <p>UPDATE 2: @petednz got me started with the answer to my main question, but as I tried to work through that correction, a deeper problem that I had hinted at up above came into full view. I am having a new and serious problem with relationship handling. I will post a new question about that.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-12-13T04:10:44.807Z
Comments.Text: "I created some fake users and gave them employers as well" - iirc to work it needs to be A/ a current employee B/ a Permissioned employee. are both criteria met and it still fails?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-12-13T14:09:57.890Z
Comments.Text: Thank you @petednz-fuzion. That did it.  Is there a way to set this as a default? Or do I need to find them all and fix them one at a time? I can build a list of individuals whose employer is not blank, but I can't see any way of fixing their permissions. I did install the related permissions extension which looks like it will solve this going forward, but doesn't seem to help fixing this now. Maybe some database poking? Is there a flag I could update in a table somewhere?
Comments.UserDisplayName: kapn
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-12-13T21:31:09.520Z
Comments.Text: I would expect that with a Relationship entity based SearchKit you would be able to update the permissions on bulk relationships. not tried it but would be worth trying imo
Comments.UserDisplayName: petednz - fuzion
Tags: <civicontribute><profile><relationships>
Title: pre-filling no longer working for membership contribution form, with inbound contact_id tokens, checksum, and "on behalf of"
ThreadText: # pre-filling no longer working for membership contribution form, with inbound contact_id tokens, checksum, and "on behalf of"
  
  (Asked by: username_0 on 2023-12-13)
  
  I am helping a small org get through a membership renewal campaign again this year that has organizational memberships. A report from a user about an error sent me looking to understand what was happening.
  
  To test, I created some fake users and gave them employers as well. So in each case there is an individual and related organizational contact. I have a contribution page that is set to "on behalf of". The page loads. It can be completed and submitted. However when entered with a URL like "https://sitename.org/civicrm/contribute/transact/?reset=1&id=21&cs=c7796dee0e6d34a976aa8a8a7ea7c25b\_1702432880\_168&cid=33557", the header shows the contact's name, the regular name and email profile at the bottom of the page is filled, but the "on behalf of" reserved profile is blank. I swear this worked last year.
  
  I tested this for multiple users with the same result. Interestingly, when I test for my own user, I get the "Membership Organization" values in the "on behalf of" profile. That is, it shows the org I am joining as a member, not the one I "work for". Not really what is intended.
  
  I also tested another site and got the same result of blank "on behalf of" profiles. If I had not used this in previous years I would just assume this function doesn't work, but I'm sure this worked last year.
  
  I'm hoping someone can shed light on this situation or offer thoughts for troubleshooting. Unfortunately, the situation has become somewhat urgent as I didn't catch this before the mailing went out. We'll need to follow up, but I would really like to have something useful to say.
  
  There are no entries of any kind in the Civi or Apache error logs. I'm running 5.68.0 on WordPress 6.4.2 and PHP 8.2.13
  
  UPDATE: Expanding my test set reveals a couple of older contacts where it works. However, looking at their relationships tab and employer field reveal that these contacts don't show their employer relationship on the relationships page. If I try to add it, I get a duplicate error. If I remove their employer, I can add them on the relationships page. However, the employer field does not visibly populate on the summary tab. If I click in to edit, it shows it filled after all, but when I click save to get out to view, it vanishes.
  Further, once I have removed and re-added the employer/employee relationship in this manner the "on behalf of" form is blank for this contact now too.
  
  I'm wondering if some sort of relationship bug may have been introduced as the interface has started to incorporate SearchKit and FormBuilder interface elements? I am absolutely baffled.
  
  UPDATE 2: @petednz got me started with the answer to my main question, but as I tried to work through that correction, a deeper problem that I had hinted at up above came into full view. I am having a new and serious problem with relationship handling. I will post a new question about that.
  
  **Tags:** civicontribute, profile, relationships
  
  > **Comments:**
  > **username_1**: "I created some fake users and gave them employers as well" - iirc to work it needs to be A/ a current employee B/ a Permissioned employee. are both criteria met and it still fails?  
  > **username_0**: Thank you @petednz-fuzion. That did it.  Is there a way to set this as a default? Or do I need to find them all and fix them one at a time? I can build a list of individuals whose employer is not blank, but I can't see any way of fixing their permissions. I did install the related permissions extension which looks like it will solve this going forward, but doesn't seem to help fixing this now. Maybe some database poking? Is there a flag I could update in a table somewhere?  
  > **username_1**: I would expect that with a Relationship entity based SearchKit you would be able to update the permissions on bulk relationships. not tried it but would be worth trying imo  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2023-12-13. Score: 1 | Accepted answer
  
  The most basic answer to this question was as PeteDNZ suggested, a matter of permissions on the relationship.
  
  
  ---
  
  