Author: Jonathan.Wage
Date: 2010-01-14 16:30:51 +0100 (Thu, 14 Jan 2010)
New Revision: 26638
Modified:
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalContentListPlugin/config/sfSympalContentListPluginConfiguration.class.php
plugins/sfSympalPlugin/trunk/lib/util/sfSympalFormToolkit.class.php
Log:
[1.4][sfSympalPlugin][1.0] Fixing issue with content lists and content_id widget
Modified:
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalContentListPlugin/config/sfSympalContentListPluginConfiguration.class.php
===================================================================
---
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalContentListPlugin/config/sfSympalContentListPluginConfiguration.class.php
2010-01-14 15:15:26 UTC (rev 26637)
+++
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalContentListPlugin/config/sfSympalContentListPluginConfiguration.class.php
2010-01-14 15:30:51 UTC (rev 26638)
@@ -23,10 +23,10 @@
public function listenForFilterVariables(sfEvent $event, $variables)
{
- if (isset($variables['sfSympalContentList']))
+ $content = $variables['content'];
+ if ($content->getType()->getName() == 'sfSympalContentList')
{
- $content = $variables['content'];
- $contentList = $variables['sfSympalContentList'];
+ $contentList = $content->getRecord();
$request = sfContext::getInstance()->getRequest();
$dataGrid = $contentList->buildDataGrid($request);
Modified: plugins/sfSympalPlugin/trunk/lib/util/sfSympalFormToolkit.class.php
===================================================================
--- plugins/sfSympalPlugin/trunk/lib/util/sfSympalFormToolkit.class.php
2010-01-14 15:15:26 UTC (rev 26637)
+++ plugins/sfSympalPlugin/trunk/lib/util/sfSympalFormToolkit.class.php
2010-01-14 15:30:51 UTC (rev 26638)
@@ -21,15 +21,18 @@
public static function changeContentIdWidget(sfForm $form)
{
- $q = Doctrine_Core::getTable('sfSympalContent')
- ->createQuery('c')
- ->leftJoin('c.Type t')
- ->leftJoin('c.MenuItem m')
- ->where('c.site_id = ?',
sfSympalContext::getInstance()->getSite()->getId())
- ->orderBy('m.root_id, m.lft');
$widgetSchema = $form->getWidgetSchema();
- $widgetSchema['content_id']->setOption('query', $q);
- $widgetSchema['content_id']->setOption('method', 'getIndented');
+ if ($widgetSchema['content_id'] instanceof sfWidgetFormDoctrineChoice)
+ {
+ $q = Doctrine_Core::getTable('sfSympalContent')
+ ->createQuery('c')
+ ->leftJoin('c.Type t')
+ ->leftJoin('c.MenuItem m')
+ ->where('c.site_id = ?',
sfSympalContext::getInstance()->getSite()->getId())
+ ->orderBy('m.root_id, m.lft');
+ $widgetSchema['content_id']->setOption('query', $q);
+ $widgetSchema['content_id']->setOption('method', 'getIndented');
+ }
}
public static function changeModuleWidget(sfForm $form)
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.