Code Monkey home page Code Monkey logo

Comments (5)

litalboa avatar litalboa commented on August 17, 2024

@ebess there is a solution to this?

from advanced-nova-media-library.

ebess avatar ebess commented on August 17, 2024

@cyclops1101 @litalboa

The detailview is not the proper place to edit some data on the product / products media imo. All custom properties are not saved by clicking the update button on the modal. You need to update/create the whole model.

Beside that, do custom properties work as expected on the edit view?

Will remove the edit custom properties icon from detail view.

from advanced-nova-media-library.

cyclops1101 avatar cyclops1101 commented on August 17, 2024

I still can't get the custom property fields to hydrate nor save when I use the form fields.

from advanced-nova-media-library.

cyclops1101 avatar cyclops1101 commented on August 17, 2024

Looking at the HandlesCustomPropertiesTrait the fillMediaCustomPropertiesFromRequest method doesn't interact with the media object. Adding the code below into the foreach loop got the media model to update appropriately.

$value = $request->{$collection . "-custom-properties"}[$index][$field->attribute];
$media->setCustomProperty($field->attribute,
$field->component === 'boolean-field' ? !!$value : $value);

from advanced-nova-media-library.

glebihan avatar glebihan commented on August 17, 2024

In case someone else faces this issue, I've noticed that the current code is only compatible with Laravel >= 5.7.
Setting custom properties on Laravel 5.6 won't work. This is the commit involved : laravel/framework@1fa9459

from advanced-nova-media-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.