-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OgComplex hardcoded to og:default selection handler #150
Comments
IMO this is fine, I think what you may be looking for is that we allow the selection handler that Og uses are the base query to be configured. Which is currently not allowed by design. EDIT: To clarify, I am not saying it shouldn't be, just that you can't do it right now. |
In D7 we do allow people to use their own selection handler, and D8 should follow it as-well With that said, we should keep people from doing mistakes that could cause data corruption (e.g. referencing non-group). |
@amitaibu How hard a requirement is it to ensure that you can't end up with data corruption/access issues? Can some of that be left to site builders if we give them information to make the decision/warnings? Specifically,
Either way, the main bit I'm stuck on at the moment is figuring out exactly what from The rest of it appears to be about the complex widget (own groups/other)? That we could manually process, though Though I'm confused as to how you can return if We could probably support Not trying to make lots of work for you! @yanniboi and I are happy to do the leg work, but want it to be viable and do it correctly... |
…e of selection handlers.
I've created a PR (#151) as I thought some code may help pick apart the issue and see whether my solution would be viable. It's not tested yet - will take a look at making it 'functional' tomorrow... |
So that is now 'operational'... It's not finished yet, as My main concern is that what should really be passed on is As an example, I'm going to hold off doing any more work on this until you've had a chance to look at it and see whether this is a good approach... |
What's harder than platinum? ;) Seriously, I'd like the API level to come with guarantees. A site builder assumes we're not allowing them to screw things up too badly. Even for an advanced dev, we should allow you to inject your own business logic - but still have those guarantees in place. The current PR seems a little off. Maybe @damiankloip will have an idea for a better approach, given his Views experience. |
I'd be interested to hear what you think is a little off in the PR. Is it just grokability or the fundamental approach? At the moment, I'm not sure there is only a guarantee that the entity wont be a group, but it could still be corrupt in any other sense that other handlers specify...There is nothing in terms of a developer being able to add in their own logic, which could include access or other validation, unless they do it in So unless damiankloip thinks a different approach is better (and the views stuff is a really small part of this that could easily be a follow-up - it seemed an easy win once the handlers were selectable), I would suggest to get closer to harder than platinum support we do the following:
|
I agree with @amitaibu, the PR seems a little on the hacky side. Sorry. It also returns responsibility back to the I still think we could do all of this in the However... there is currently one issue with that which would need to be fixed first, and that is https://www.drupal.org/node/2666202 |
A |
@damiankloip thanks for taking a look at the code. I am unsure as to whether The implementation of Or were you were thinking we could leave it entirely to the selected plugin? In which case, we could instead alter the config form to ensure the selected handler and configuration is valid and query alters (which would also depend on an addition to core so that the views selection passed on the full selection info) and not have an Have I understood you correctly? |
Hmm, yes. This could pose some issues, you're right. That puts a nice clean solution to bed then :) Although, maybe we could just implement our own alter on the query (
|
Yes, I was thinking that Those two things lead me to wondering if we can drop |
Based on a quick chat with @damiankloip in IRC, I'm going to try putting together some code that moves away from using He mentioned that @amitaibu had previously talked about wanting to use if for other purposes, so I will keep it in place and find a way to prevent duplicating code - we can always remove it later if we feel it's no longer needed. |
Not sure if this is relevant to #17.
Problem/Motivation
When editing a field of field type OgMembershipReferenceItem (like og_group_ref) if you change the selection handler (for example to an entity reference view) the entity reference field widget (OgComplex) does not use the views selection handler, it is hardcoded to use 'og:default'.
Proposed resolution
Not entirely sure how to architect the solution, whether 'og:default' should be able to adapt depending on the selection handler defined in the field settings or whether OgComplex should look up the selection handler and pass over to ViewsSelection rather than OgSelection.
The text was updated successfully, but these errors were encountered: