vdm-io / JCB-Community-Packages

Community Mapped Components for JCB
14 stars 6 forks source link

Naming Convention for Fields #4

Open LordRazen opened 3 years ago

LordRazen commented 3 years ago

Steps to reproduce the issue

Create a field called "model" and use it in your components admin view.

Expected result

It should work...

Actual result

...but there's an error message: "call member function selectionTranslation() on string."

Additional comments

Well due to earlier mistakes, I found the reason a lot quicker: https://github.com/vdm-io/Joomla-Component-Builder/issues/686

The fix was a rename to another name, away from the name "model".

So I recommend to add the naming convention url to the description of the property "name" for any field, too.

That's all, it's not a bug, it's intentional. I just recommend to adjust the docu.

Llewellynvdm commented 3 years ago

Thanks for the heads-up, in what area would you like the better description, and what should that description be?

Share some screen shots of the area with the proposed improvement. We welcome these kind of things... keep them coming.

LordRazen commented 3 years ago

Fields Section -> Field -> Set Properties -> name

"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute. "

Add this url: https://docs.joomla.org/J3.x:File_Structure_and_Naming_Conventions With the input that there're reserved words which cannot be used (second chapter of the url)

Llewellynvdm commented 3 years ago

Okay I see... this you can already do locally in your own install...

But yes we can update these, just a heads-up when updating JCB, this will not update these values, you will need to check the following tutorial to understand how those are updated: https://www.youtube.com/watch?v=kbn-DF6zXlo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=93

LordRazen commented 3 years ago

Well, me in person, I kinda recognize this problem since I had it twice for now.

But for others this info might reduce the amount of debugging a lot ^^

Thanks for adding it.

Llewellynvdm commented 3 years ago

@TLWebdesign this is yet another one ;)

@LordRazen if you see more fieldtype improvements, just open it in this repository as we have the fieldtype updater package here.