Jump to:

10845 Posts in 2516 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » FAQ module

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 4260 Views
  • Ssendol
    Avatar
    Community Member
    1 Post

    FAQ module Link to this post

    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.php

    Source
    ======
    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.php

    ViewableData->XML_val(Field)
    line 370 of FormField.php

    FormField->FieldHolder()

    call_user_func_array(Array,Array)
    line 408 of ViewableData.php

    How can I fix this problem ?
    Thanks...
    ViewableData->XML_val(FieldHolder,,1)
    line 74 of .cache.var.www.ss.sapphire.templates.TabSetFieldHolder.ss

    include(/tmp/silverstripe-cache-var-www-ss/.cache.var.www.ss.sapphire.templates.TabSetFieldHolder.ss)
    line 354 of SSViewer.php

  • Mehanik
    Avatar
    Community Member
    1 Post

    Re: FAQ module Link to this post

    I faced the same problem!!!

    MultiSelectField module is installed.

    Please help!

  • OnebyOne
    Avatar
    Community Member
    54 Posts

    Re: FAQ module Link to this post

    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

  • rgo
    Avatar
    Community Member
    13 Posts

    Re: FAQ module Link to this post

    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.

  • rgo
    Avatar
    Community Member
    13 Posts

    Re: FAQ module Link to this post

    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

  • pst
    Avatar
    Community Member
    9 Posts

    Re: FAQ module Link to this post

    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.

  • OnebyOne
    Avatar
    Community Member
    54 Posts

    Re: FAQ module Link to this post

    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;
       }

  • Chucky2k
    Avatar
    Community Member
    32 Posts

    Re: FAQ module Link to this post

    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

    4260 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.