Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have Payment form field on User Entities so I can set an amount that individual users owe. I'm using Field Permissions so only admins can change the amount someone owes. An error occurs when a user tries to update their username/password (ex: /user/2/edit page) - the Payment form field is not displayed for them, however it is still trying to get validated in the payment.ui.inc file:
Warning: strlen() expects parameter 1 to be string, array given in payment_form_process_line_item_validate() (line 862 of /home/clients/websites/w_emc/public_html/emc/sites/all/modules/payment/payment/payment.ui.inc).
Let me know if there is a work around I can try. Thanks.
Comment | File | Size | Author |
---|---|---|---|
#4 | 4-_error_on_Save.png | 107.92 KB | kruser |
#4 | 3_-_set_balance.png | 14.86 KB | kruser |
#4 | 2-_field_permissions.png | 36.67 KB | kruser |
#4 | 1-_User_field.png | 29.56 KB | kruser |
Comments
Comment #1
XanoCan you provide step-by-step instructions on how to reproduce this problem on a clean installation of Drupal 7.x-dev and Payment 7.x-1.x-dev?
Doing the same for Drupal 8.x-dev and Payment-8.x-2.x would be helpful, as we'll need to make sure this bug isn't in Payment 8.x-2.x as well, before we can fix it in 7.x-1.x.
Comment #2
XanoClosing due to lack of response. Please re-open this issue only if you have information that describes the problem in more detail or helps other people reproduce the bug on their computers.
Comment #3
kruser CreditAttribution: kruser commentedComment #4
kruser CreditAttribution: kruser commentedHi,
Sorry for the delay. Steps to reproduce:
1. Add Payment form field to a USER @ admin/config/people/accounts/fields (I called it balance due)
2. Set the Field permissions, so members can see the payment Due, but not edit it.
3. For each user I set a Payment Due
4. If a member logs in, updates their profile and clicks Save, an error occurs.
(I attached screenshots for reference.)
If I set the field permissions to allow the member to edit the balance due, then there is no error when they save. But we don't want to let members edit their balance obviously, so we are hiding the fields with CSS as a temp fix.
Thanks.
Comment #5
XanoIs this for 8.x-2.x or 7.x-1.x? Also, field permissions are not part of core. Please repost the instructions and include the parts that describe how to set the field permissions.
Comment #6
XanoClosing due to lack of response.
Comment #7
vlooivlerke CreditAttribution: vlooivlerke commentedI can confirm this.
I use entity forms where the user submits a form with a payment field (empty) then admin will edit the entity form and add amount to empty payment form. The submitter of the entity form can then visit the form view and select a payment method and click pay.
This will create a payment.
Now if the user try to edit the entity form he created he will get this error described here.