Skip to content

Commit 68eeb08

Browse files
authored
Merge pull request #4514 from Laravel-Backpack/check-if-method-exists-before-calling
check if method exists before calling
2 parents a06d04e + 73a7ee1 commit 68eeb08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/Library/CrudPanel/Traits/Update.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private function getModelAttributeValueFromRelationship($model, $field)
194194
*/
195195
private function setupRelatedModelLocale($model)
196196
{
197-
if ($model->translationEnabled()) {
197+
if (method_exists($model, 'translationEnabled') && $model->translationEnabled()) {
198198
$locale = request('_locale', \App::getLocale());
199199
if (in_array($locale, array_keys($model->getAvailableLocales()))) {
200200
$model->setLocale($locale);

0 commit comments

Comments
 (0)