Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Forking the xml in the model/forms folder and JDom 03 Oct 2013 06:58 #11291

  • VeCrea
  • VeCrea's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
Would it be possible ?
Thanks,
V.

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

Forking the xml in the model/forms folder and JDom 10 Oct 2013 00:06 #11360

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
It is possible to fork them now, but only limited to add or modify existing fields.
You cannot remove a field from XML.
You can eventually set it to hidden, but not the cleanest.

Limitations are for the others XML files (config, layout, ...)
Coding is now a piece of cake

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

Forking the xml in the model/forms folder and JDom 19 Oct 2013 21:51 #11419

I think there may be a bug when you have a radio type field in a forked xml.

The preprocessForm method is calling the $form->load method which is removing the radio fields.

Here is the calling code: (in classes/model/item.php)
$baseFolder = JPATH_COMPONENT .DS. 'fork' .DS. 'models' .DS. 'forms';
$formFile = $baseFolder .DS. $this->view_item .'.xml';
if (file_exists($formFile))
{
$xml = simplexml_load_file($formFile);
$form->load($xml, true);
}

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

Forking the xml in the model/forms folder and JDom 29 Nov 2013 00:16 #11707

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
I got it.

This is a problem in Joomla.

You must hack a line:
libraries/joomla/forms/forms.php - LINE 723
$olddom = dom_import_simplexml($current);
$loadeddom = dom_import_simplexml($field);

//HERE FIX JOOMLA ISSUE
//-$addeddom = $olddom->ownerDocument->importNode($loadeddom);
$addeddom = $olddom->ownerDocument->importNode($loadeddom, true);
//
$olddom->parentNode->replaceChild($addeddom, $olddom);
$loadeddom->parentNode->removeChild($loadeddom);
Coding is now a piece of cake

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

Forking the xml in the model/forms folder and JDom 05 Jan 2014 21:29 #11914

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Coding is now a piece of cake
The following user(s) said Thank You: JoomGuy

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

  • Page:
  • 1
Time to create page: 0.086 seconds

  I want to save the world...... let's cook a solution about it.
VeCrea (Forum)

Get Started