Skip to content

Commit

Permalink
Fixed issue #13515: Cannot have a null default value when creating cu…
Browse files Browse the repository at this point in the history
…stom attributes in a custom question theme
  • Loading branch information
dominikvitt committed May 16, 2018
1 parent 2e60948 commit 08677d1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions application/controllers/admin/questions.php
Expand Up @@ -1664,6 +1664,7 @@ public function ajaxquestionattributes()
// INSERTING EACH OF THIS KEYS TO THE ARRAY IF KEYS ARE MISSING
if (empty($attribute['name'])){$attribute['name'] = 'default_theme_attribute_name';}
if (empty($attribute['readonly'])){$attribute['readonly'] = '';}
if (empty($attribute['default'])){$attribute['default'] = '';}
if (empty($attribute['readonly_when_active'])){$attribute['readonly_when_active'] = '';}
if (empty($attribute['value'])){$attribute['value'] = '';}
if (empty($attribute['i18n'])){$attribute['i18n'] = '';}
Expand Down

2 comments on commit 08677d1

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like to use array_merge($default,$setting) for such usage, i think it's better understandable :)

@dominikvitt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that is a good point, would keep it in mind.

Please sign in to comment.