? Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
23 May 2017

Summary of Changes

With the move to namespaces, we didn't touch the location of the component form files, eg. article.xml. They are still in a folder like /components/com_content/models/formsl. This location was valid when we had the models in that folder. Now the model classes are in a different folder. So I think the form files should be moved to a location where it makes more sense and obvious for new component developers.

This pr moves the form files to the root forms folder within the component root folder. So /components/com_content/models/forms/article becomes /components/com_content/forms/article.xml.

This pr was inspired by #15221 and is fully BC compatible as all the rest of the edit forms should work as before. If this pr get accepted, we need to move all the form files of all the namespaced components.

Testing Instructions

  • Open an article in the back end and save it
  • Edit an article on the front

Expected result

All should work as before.

Actual result

Nothing is broken all should work.

Documentation Changes Required

This new location needs to be documented.

avatar laoneo laoneo - open - 23 May 2017
avatar laoneo laoneo - change - 23 May 2017
Status New Pending
avatar laoneo laoneo - edited - 23 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 23 May 2017
Category Administration com_content Front End Libraries
avatar izharaazmi
izharaazmi - comment - 24 May 2017

Great. I always wanted this change. However, I'd prefer the singular Form over forms.

For field path and rule path, I'd suggest them to be inside this form folder like Form/Field and Form/Rule which IMO also agrees to the namespace pattern.

avatar mbabker
mbabker - comment - 24 May 2017

Eventually the PHP classes should move to a file path where they get autoloaded. But there is a fair bit of work needed with JForm to get there (including support for namespaced classes and deciding when we're going to do the B/C break of not having every core extension's form classes using the JForm class prefix).

avatar izharaazmi
izharaazmi - comment - 24 May 2017

Alright. I can't say I get that exactly. Since I've not yet stepped into 4.x dev I find myself ineligible to speak much. My joomla.todo is still filled with 3.x stuffs. All the best everyone here. I'll be catching up soon. ☺

avatar laoneo
laoneo - comment - 24 May 2017

An approach how to namespace JForm can be found in this pr #15893. I would not mix xml files and PHP classes in the same folder. Thats why the forms folder is lowercase and should only contain xml files. IMO the field classes should belong into the Field folder.

avatar mbabker
mbabker - comment - 24 May 2017

FWIW in the Framework repo we actually deprecated and removed in full support for looking up class objects using the file path lookups in favor of full autoloading support, so the only file path stuff left there is for the XML files (for obvious reasons). That should be our long term goal with the CMS, it's just going to be a painfully long transition.

avatar wilsonge wilsonge - close - 29 May 2017
avatar wilsonge wilsonge - merge - 29 May 2017
avatar wilsonge wilsonge - change - 29 May 2017
The description was changed
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-05-29 17:20:18
Closed_By wilsonge
Labels Added: ?

Add a Comment

Login with GitHub to post a comment