CRUD: Translatable fake field not working in CRUD 3.4.23

Bug report

Translateable fake fields store values in database but don’t display the values in crud/edit after updating form backpack/crud (3.4.5 => 3.4.23)

What I did:

Migration:

  Schema::create('tests', function (Blueprint $table) {
            $table->increments('id');
            $table->text('i18ndatafake')->nullable();
        });

Created new Testmodel/CRUD:

protected $fillable = ['i18ndatafake'];
protected $translatable = [ 'i18ndatafake' ];
protected $fakeColumns = ['i18ndatafake'];
protected $casts = ['i18ndatafake' => 'array'];

Crud Controller:

        $this->crud->addField([
            'name' => 'title',
            'label' => 'title',
            'fake' => true,
            'store_in' => 'i18ndatafake'
        ]);

        $this->crud->addField( [
            'name' => 'description',
            'label' => 'description',
            'fake' => true,
            'store_in' => 'i18ndatafake',
        ]);

Database after insert: i18ndatafake {“de”:{“title”:“title german”,“description”:“description german”},“en”:{“title”:“title englisch”,“description”:“description english”}}

Problem

Crud/Edit Fields are empty after saving.

This worked fine in CRUD 3.4.5

Backpack, Laravel, PHP, DB version:

Laravel: 5.6.27 PHP: 7.1.11 MySQL: 5.7.11 backpack/crud: 3.4.23

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (13 by maintainers)

Commits related to this issue

Most upvoted comments

3.4.25 works for me too, thank you guys!