annismckenzie/ahDoctrineEasyEmbeddedRelationsPlugin — Issue #9: Cloning does not work automatically
Author: battika
Created: 2012-01-02 11:07:43+00:00
State: open

Hello,

Sorry for the newbie question but I'm trying to get ahDoctrineEasyEmbeddedRelationsPlugin work using a simple schema detailed in this article:
http://prendreuncafe.com/blog/post/2009/11/29/Embedding-Relations-in-Forms-with-Symfony-1.3-and-Doctrine

It works fine and it's great but the client-side JQuery script (ahDoctrineEasyEmbeddedRelationsPlugin.jQuery) does not get included automatically for some reason so my add button does not work. When I manually include the Javascript file the add button starts working Okay, and I can submit multiple new entries.

My form's configure method is the following:

embedRelations(array(
'Bookmarks' => array(
'considerNewFormEmptyFields' => array('name', 'url'),
'newFormLabel' => 'Create a new bookmark',
'newFormClass' => 'BookmarkForm',
'formClass' => 'BookmarkForm',
'multipleNewForms' => 'true',
'newFormsInitialCount' => 1,
'newFormsContainerForm' => null,
'newFormAfterExistingRelations' => true,
'newRelationButtonLabel' => '++',/
'newRelationAddByCloning' => true,
'newRelationUseJSFramework' => 'jQuery',
'customEmbeddedFormLabelMethod' => 'getLabelTitle'

)
));
$this->widgetSchema->setNameFormat('user_bookmarks[%s]');
}
}

My "newRelationAddByCloning" option is true and my JS framework is set as JQuery but ahDoctrineEasyEmbeddedRelationsPlugin.jQuery.js script still doesn't gets included. As far as I can see getJavaScripts() function in the ahNewRelationField.php file is responsible for that but the function never seems to get called by anyone.

I believe I'm missing some very basic step can anyone please give me some pointers where to look at?

Thanks in advance.