Select user field in new subscription form

  • Mark
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 11 months ago #81921 by Mark
The modal dialog created by the "pick a user" field on the new subscription form no longer returns.

Chrome's debug console reports "jQuery is not defined".

I'm guessing, from the lack of noise here (& anywhere else), that you haven't changed Membership Pro for this to make up for a change in the Joomla core (no longer loading jQuery automatically), is that right?

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #81922 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Select user field in new subscription form
Hi Mark

Are you using latest version (2.3.0) of Membership Pro ?

Tuan

Please Log in or Create an account to join the conversation.

  • Mark
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 11 months ago #81925 by Mark
:(

Sorry Tuan, I meant to say that. No, I'm on 2.1.0

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #81926 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Select user field in new subscription form
Please update to version 2.3.0 and the issue will be gone. Joomla 3.5.0 made some changes to the code, so we had to change code in Membership Pro to make the selection works again (few weeks ago)

Tuan
The following user(s) said Thank You: Mark

Please Log in or Create an account to join the conversation.

  • Mark
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 11 months ago - 7 years 11 months ago #81927 by Mark
Will do.
Can you tell me what the change was? I have components of my own that may need changing.

It seems to be that the user field requires jQuery, but doesn't load it, which is surely at best poor practice and at worst a bug. D'you think?

Thx
Mark
Last edit: 7 years 11 months ago by Mark.

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #81952 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Select user field in new subscription form
I don't remember exactly. In the older version, we used standard HTML code + some js (based on Joomla user field type mark up if I remember correctly). In the new version, we had to change the method getUserInput in components/com_osmembership/helper/helper.php to use Joomla core JFormField and it works OK

Here is the new code
Code:
public static function getUserInput($userId, $subscriberId) { $field = JFormHelper::loadFieldType('User'); $element = new SimpleXMLElement('<field />'); $element->addAttribute('name', 'user_id'); $element->addAttribute('class', 'readonly'); if (!$subscriberId) { $element->addAttribute('onchange', 'populateSubscriberData();'); } $field->setup($element, $userId); return $field->input; }

Regards,

Tuan
The following user(s) said Thank You: Mark

Please Log in or Create an account to join the conversation.