fieldtype prefixing #441

Closed
opened 2019-07-12 15:49:28 +00:00 by marcodings · 1 comment
marcodings commented 2019-07-12 15:49:28 +00:00 (Migrated from github.com)

Custom fields in joomla typically have a prefix of "J" as in "JFormFieldEventtype". The "J" prefixing was actualy reserved for core. The "proper" way to add custom fields is to add you Own prefix.
So i would use "B42FormFieldEventtype" and the resulting field type would be b42.Eventtype. This This adds "namespacing to your fieldstype and avoids conflicts.

With JCB i run into 2 problems

  1. the prefix syntax is not supported, the "." is filtered
  2. the 42 is still converted to forty_two

so if i specify a field_type of "b42.eventtype" i end up with
"bforty_twoenventtyp" (no prefixing and numbers converted" making it "imposible" to use that field type

after manually manipulating the form

image

show the proof of concept

Custom fields in joomla typically have a prefix of "J" as in "JFormFieldEventtype". The "J" prefixing was actualy reserved for core. The "proper" way to add custom fields is to **add you Own prefix**. So i would use "B42FormFieldEventtype" and the resulting field type would be b42.Eventtype. This This adds "namespacing to your fieldstype and avoids conflicts. With JCB i run into 2 problems 1) the prefix syntax is not supported, the "." is filtered 2) the 42 is still converted to forty_two so if i specify a field_type of "b42.eventtype" i end up with "bforty_twoenventtyp" (no prefixing and numbers converted" making it "imposible" to use that field type after manually manipulating the form ![image](https://user-images.githubusercontent.com/3484222/61141105-1a6b4780-a4cd-11e9-9bf0-2e100bfc1301.png) show the proof of concept

Please test and let me know 👍

Please test and let me know :+1:
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#441
No description provided.