9526 Posts in 1941 Topics by 1529 members
| Go to End | Next > | |
| Author | Topic: | 3559 Views |
-
FAQ module

1 September 2009 at 9:01pm
I tried install FAQ module in SS 2.3.1.
I installed MultiSelectField v.0.2 and installed Faqs V0.5.
But I get error when I create 'Faq Page' in Admin. 'Faqs Holder' is OK.Error as follow;
ERROR [Warning]: Invalid argument supplied for foreach()
IN POST /ss/admin/getitem?ID=23&ajax=1
Line 33 in /var/www/ss/multiselectfield/code/MultiSelectField.phpSource
======
24: 'class'=>$this->extraClass()
25: );
26: if ($this->disabled)
27: $attributes['disabled'] = 'disabled';
28:
29: // Build options
30: $content = '';
31: $source = $this->source;
32: $value = $this->getSelected();
* 33: foreach($source as $index => $item) {
34: $selected = (isset($value[$index])) ? 'selected' : '';
35: $content .= "<option $selected value=\"$index\">$item</option>";
36: }
37:
38: return $this->createTag('select', $attributes, $content);
39: }<ul>MultiSelectField->Field()
call_user_func_array(Array,Array)
line 408 of ViewableData.phpViewableData->XML_val(Field)
line 370 of FormField.phpFormField->FieldHolder()
call_user_func_array(Array,Array)
line 408 of ViewableData.phpHow can I fix this problem ?
Thanks...
ViewableData->XML_val(FieldHolder,,1)
line 74 of .cache.var.www.ss.sapphire.templates.TabSetFieldHolder.ssinclude(/tmp/silverstripe-cache-var-www-ss/.cache.var.www.ss.sapphire.templates.TabSetFieldHolder.ss)
line 354 of SSViewer.php -
Re: FAQ module

6 September 2009 at 10:24pm
I faced the same problem!!!
MultiSelectField module is installed.
Please help!
-
Re: FAQ module

8 September 2009 at 3:57am
I installed latest stable faqs and multiselectfield modules from (Extensions/Module zone) and latest SS (2.3.3) and is working, at least i have no error,
I can create faqs pages, but the Faqs Holder is empty - shouldn't Faqs Holder show the faqs like a the blog module ?
THX
-
Re: FAQ module

5 October 2009 at 9:33am
I cannot reproduce the error with Silverstripe v2.3.3. I'll check previous version. Regarding FaqsHolder question: It should show a list of children pages. Without sidebar and without a theme the page list stay at left of the holder page. I'll make a theme sample for faqs module.
-
Re: FAQ module

5 October 2009 at 10:56am
I just try the Silverstripe v2.3.0 and faqs Module works. If the errors still occurs please let me know the installed modules. Tested on Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.2 with Suhosin-Patch
-
Re: FAQ module

7 October 2009 at 11:42pm Last edited: 7 October 2009 11:42pm
I can confirm the problem. It seems, that the syntax for the multiselectfield has changed. There is not changelog for the multiselectfield module, but the README states a change.
I have faqsmodule 0.5.0 and multiselectfield 0.2
Changing the addfieldtotab to the following seems to fix the problem.
// -- Related Faqs
$source = DataObject::get('FaqsPage');
$fields->addFieldToTab(
"Root.Content.Related",
new MultiSelectField(
"FaqsRelated", // Relationship
"Related Faqs", // Field name
$source->toDropdownMap('ID','Title') // Source records (array)
)
);But the multiselectfield does not look like the screenshot here -> (http://silverstripe.org/multiselectfield-module/). It only has the left box and you can select and deselect RelatedFaqs using ctrl-key.
-
Re: FAQ module

16 October 2009 at 2:00am
yes, is working, first time i deleted by mistake the
return $fields;
}
and the system crashed.so, here is the complete code, Change in FaqsPage.php (under code in faqs module)
this// -- Related Faqs
$fields->addFieldToTab("Root.Content.Related", new MultiSelectField(
"FaqsRelated", _t("FaqsPageEntry.RELATEDLABEL", 'Related'), "FaqsPage", "ID", "Title"));
return $fields;
}with this
// -- Related Faqs
$source = DataObject::get('FaqsPage');
$fields->addFieldToTab("Root.Content.Related",new MultiSelectField(
"FaqsRelated", "Related Faqs", $source->toDropdownMap('ID','Title') )
);
return $fields;
} -
Re: FAQ module

18 October 2009 at 6:03pm
Hi,
I have this working now after the mod posted by OnebyOne, however, I have one small problem in that I can select one FAQPage for related FAQ and all saves fine. If I try to select more than one, after the save there none remain.
Cheers
David
| 3559 Views | ||
| Go to Top | Next > |



