Git Product home page Git Product logo

Comments (5)

Pierstoval avatar Pierstoval commented on May 18, 2024

Can't we inject the configurator inside this twig extension and check the entity config in order to retrieve the primary key value ?

from easyadminbundle.

ogizanagi avatar ogizanagi commented on May 18, 2024

Yes, that's the main solution.
I opened this issue because I wonder if this worth the dependency, as the workaround is pretty easy, and a getId method on an entity isn't a non-sense anyway.

from easyadminbundle.

Pierstoval avatar Pierstoval commented on May 18, 2024

I think that injecting the configurator in the twig extension might be right, as it's also probably the best way to get the whole entities list and make it a "view-accessible" property, instead of passing it as parameter from the controller (which is kind boring when extending the AdminController).

Sounds good to me to add this dependency to the twig extension :)

tag @javiereguiluz

from easyadminbundle.

javiereguiluz avatar javiereguiluz commented on May 18, 2024

I'm going to think about this issue because it looks wrong to provide support for non-id primary keys and then, don't make this little extra effort to provide cool links for associations.

from easyadminbundle.

ogizanagi avatar ogizanagi commented on May 18, 2024

Did not make a PR for now, but here is what was ready to be done considering this issue.
Maybe it'll be helpful.

I'm not fan of the try/catch, but simple way to keep something to display if the entity isn't configured to be used in the bundle, and avoiding generating broken link as currently.

I think it would be helpful to handle the fact the entity isn't present in the bundle configuration in the getEntityConfiguration method. (returning null and avoid triggering exceptions)

from easyadminbundle.

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.