Need help with Joomla? We are available for hire to help with Joomla customization, upgrades, maintenance, and custom development.
Explore our services

[SOLVED] Custom fields in child events

  • Trevor Smith
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
6 years 11 months ago #129816 by Trevor Smith
Custom fields in child events was created by Trevor Smith
Hi

I have added some custom fields to an event but if I create a child event the custom fields are not shown in the registration form for the child event. Is there an option somewhere to include custom fields from the parent in child events?

regards
Trevor

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

More
6 years 11 months ago #129827 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom fields in child events
Hi Trevor

We do not have that option available. You will need to assign custom field to both parent and children events in this case

Regards,

Tuan

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

  • Trevor Smith
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
6 years 11 months ago #129852 by Trevor Smith
Replied by Trevor Smith on topic Custom fields in child events
Hi Tuan

OK, that's a shame.

I might try writing a plugin using onAfterSaveEvent to copy the necessary rows in the #_eb_field_events table. Sounds straightforward but perhaps there is a bit more to it?

Best regards
Trevor

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

More
6 years 11 months ago #129856 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom fields in child events
That should be enough. The other option would be implement an override for getFormFields method in EventbookingHelperRegistration class

Attached is the override. You can get this file, unzip it, upload to components/com_eventbooking/helper/override folder on your site, then check to see if it works as expected (I coded it quickly without testing)

Regards,

Tuan
The following user(s) said Thank You: Trevor Smith

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

  • Trevor Smith
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
6 years 11 months ago #129872 by Trevor Smith
Replied by Trevor Smith on topic Custom fields in child events
Many thanks Tuan

I will test it later today.

Best regards
Trevor

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

More
6 years 11 months ago #129879 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom fields in child events
OK Trevor

Please update me with the result once you tested it

Regards,

Tuan

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

  • Trevor Smith
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
6 years 11 months ago #129890 by Trevor Smith
Replied by Trevor Smith on topic Custom fields in child events
Hi Tuan

Sorry I ran out of time yesterday so will test it today and will report back.

Best regards
Trevor

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

More
6 years 11 months ago #129891 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom fields in child events
Don't worry Trevor. Take your time

Tuan

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

  • Trevor Smith
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
6 years 11 months ago #129899 by Trevor Smith
Replied by Trevor Smith on topic Custom fields in child events
Hi Tuan

I created a custom field and assigned it to an event. I then added an additional date to the event but when I tried to register I get the following error:
Code:
1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'OR event_id < 0)) AND id NOT IN (SELECT field_id FROM jos_eb_field_events WHERE ' at line 3

I could register for the parent event OK but the error was thrown when registering for the child.

I checked the eb_field_events table and it only contained the entry for the parent event.

Best regards
Trevor

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

More
6 years 11 months ago #129904 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom fields in child events
Sorry Trevor

I had a small typo in the code. Please use this updated file and it should be fine

Regards,

Tuan

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

Moderators: Tuan Pham Ngoc