Comments (5)
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.
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.
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.
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.
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)
- crud edit header - border is not visible / css HOT 1
- CollectionField with json
- Allows ToggleSwitch to dispatch a subscribable event
- Search not working with POSTRGES HOT 7
- Toggle switch on/off not working HOT 2
- Association Entity Return value must be of type string, null returned HOT 1
- [BUG UI] Highlight search results in darkmode not lisible
- PR #6200 : Unsupported operand types: string + int HOT 4
- Asterisks in the required form fields are only visible once
- custom action with voter hides action on dropdown but you can still perform the action by copying the link HOT 1
- How to compute dynamically totals in an index CRUD view ? HOT 2
- Pagination bug when I use setEntityPermission
- FormField::addFieldset setHtmlAttribute does nothing
- allow dynamically generated forms
- Selecting a COUNT() from related entity provides valid query, but null result in the field HOT 1
- LanguageField doesn't support multiple choices HOT 3
- EntityManager::addSearchClause throw exception on Postgresql databases HOT 1
- Dynamic label for custom actions
- Inconsistent behaviour when no entityId is passed to detail page
- Stop using PATCH HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easyadminbundle.