When setting the border radius to 0 the theme is not effected. Setting it to 1 does work, but 0 used to work as well.

admin/appearance/settings/socialblue

Comments

Taco Potze created an issue. See original summary.

left’s picture

Assigned: Unassigned » left
left’s picture

Assigned: left » Unassigned
Status: Active » Needs review
kingdutch’s picture

Status: Needs review » Needs work

Hey Lisa,

I think we can do better here. Instead of changing the if statements. Let's fix the underlying function that parses it.

I already made a related comment on the change that caused this regression here: https://github.com/goalgorilla/open_social/pull/669#discussion_r156110032

We can probably put the old code that was there before the refactor into the function. So then the contents of improved_theme_settings_get_setting (see https://github.com/goalgorilla/open_social/commit/96db617d77080272c10ade... ) would become more like:

/**
 * Function that returns a valid integer or FALSE.
 */
function improved_theme_settings_get_setting($setting, $themename) {
  // Fetch setting from the theme.
  $themevar = Xss::filter(theme_get_setting($setting, $themename));
  
  // Convert possible strings (e.g. "5 ") to proper integers.
  if (is_string($themevar)  && trim($card_radius) !== '') {
    $themevar = intval($themevar);
  }
  
  // If we have a valid integer value, use it.
  if (is_integer($themevar)) {
    return $themevar;
  }

  return FALSE;
}

The above code has been written in the comment field so may contain untested typoes. ^^

left’s picture

@kingdutch

Thanks for the input. For now, we have merged the initial commit (https://github.com/goalgorilla/open_social/pull/761) as this bug has been open for a while and some people are keen to get it fixed.

This is not really a frontend task, so I am reclassifying it and leaving it as needs work so someone with more Php knowledge can implement a better solution based on your proposed solution.

left’s picture

Component: Front-End » Code (back-end)

  • left authored 50764cc on 8.x-1.x
    Merge pull request #761 from goalgorilla/bugfix/2933170-border-radius-...
jaapjan’s picture

Status: Needs work » Fixed

Marking as fixed for now as the original issue is solved as per pull/761. If we want to improve on it further we can do so in a different issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.