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.151 seconds

Although I found this tool some time ago I just started learning experimenting and building this first component on Monday and now on Thursday afternoon it's already online. Although I already had a working version done with another tool this is much easier to build and at the end you have the freedom to own your own component. Once you know how to use Cook you will boost your productivity as the learning curve is really moderate compared to many other tools.
Giori (Forum)

Get Started