We have moved to Github. Please open tickets there.

Opened 17 months ago

Last modified 13 months ago

#4235 new Defect

Using checkboxes with widget settings

Reported by: coldtrick Owned by:
Priority: normal Milestone: Elgg 1.8.x
Component: Core Version: 1.8
Severity: minor Keywords:
Cc: brett@… Difficulty:

Description (last modified by ewinslow)

Before Elgg 1.8 is was possible to save widget settings which were an array. This was done by saving as metadata in case of an array.

A few widgets (in widget_manager plugin) use checkboxes as widget settings. This should be saved as an array. However in 1.8 this situation has changed. Saving an array is no longer possible as the "fallback" to metadata is no longer present. I would like to see it returned in 1.8.3, because we need this option.

Change History (3)

comment:1 Changed 17 months ago by cash

  • Version changed from Github Master to 1.8

Here's the relevant code from Elgg 1.7 in save_widget_info():

if (is_array($value)) {
    // @todo Handle arrays securely
    $widget->setMetaData($name, $value, "", true);
} else {
    $widget->$name = $value;
}

New code from Elgg 1.8 in ElggWidget:saveSettings():

if (is_array($value)) {
    // private settings cannot handle arrays
    return false;
} else {
    $this->$name = $value;
}

This is related to #4072

comment:2 Changed 15 months ago by coldtrick

Any progress? Would love to see it in 1.8.4

comment:3 Changed 13 months ago by ewinslow

  • Description modified (diff)
  • Milestone changed from Needs Review to Elgg 1.8.x

Can you submit a pull request? That'd be great. Thanks. Since this worked prior to 1.8, I think we can include it in the 1.8.x series.

Note: See TracTickets for help on using tickets.