Skip to content

Commit

Permalink
Fixed issue #14786: application warning : Failed to set unsafe attrib…
Browse files Browse the repository at this point in the history
…ute "settings" of "Tutorial". (#2092)
  • Loading branch information
gabrieljenik committed Oct 22, 2021
1 parent c2d86cb commit 8b86524
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion application/models/Tutorial.php
Expand Up @@ -157,7 +157,10 @@ public function getDefaultTutorials()
$result = [];
foreach ($aDefaultTutorials as $aDefaultTutorial) {
$oTutorial = new Tutorial();
$oTutorial->setAttributes($aDefaultTutorial);
// We set the attributes passing $safeOnly = false to avoid a warning on 'settings' attribute (issue #14786).
// The data comes from LsDefaultDataSets, so we can asume it's safe.
// A "better" approach would be to add a rule for the 'settings' attribute, but it seems overkill at this point.
$oTutorial->setAttributes($aDefaultTutorial, false);
$result[] = $oTutorial;
}
return $result;
Expand Down

0 comments on commit 8b86524

Please sign in to comment.