-
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
Groups added to the 'Other groups' field are lost on submit #149
Conversation
These changes are inspired by the excellent Travis integration of the Rules module.
…ld through the UI.
Above test fails correctly because it detects that it is impossible to add groups through the 'Other groups' field. |
This fixes it and should turn the test green. Note that there is still a bug left: it now hardcodes the field name, so it only works for one group audience field. This will be tackled when I get to |
|
||
// Get the groups from the other groups widget. | ||
foreach ($form['other_groups'] as $key => $value) { | ||
// @todo Don't hardcode 'og_group_ref' - there can be multiple fields. | ||
foreach ($form['og_group_ref']['other_groups'] as $key => $value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this->fieldDefinition->getName()
👍
Thanks @damiankloip! Much obliged :) |
// @see https://github.com/amitaibu/og/issues/144 | ||
/** @var EntityFormDisplayInterface $form_display */ | ||
$form_display = \Drupal::entityTypeManager()->getStorage('entity_form_display')->load('node.post.default'); | ||
$widget = $form_display->getComponent('og_group_ref'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as indicated in the issue, this one troubles me a bit (even if it's an intermediate step). I'd be happy to see the next step to make this work for all audience fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok let's do #144 first, it should be pretty trivial.
…hat issue #144 is fixed.
See the documentation for entity_get_form_display().
The tests started failing after merging in the master branch. It was due to the OgStandardReferenceItem that was added in #128 - it was using the wrong validator, causing the following error when saving a node that references a group:
This test was actually detecting that already :) @amitaibu, I have fixed the visibility of the group audience field in #153, this is merged into this issue. The fix to make it work with all audience fields has also been applied. Is there anything else that needs to be done here? |
I created a separate issue for the fatal error when saving group content, so that it is more easily discoverable if someone runs into this problem: #154. |
@amitaibu Checked it and the other groups widget works very good. |
Groups added to the 'Other groups' field are lost on submit
Merged, thanks! |
I noticed that the 'Other Groups' field is not working at all. There are two bugs there:
NULL
is added to the list.$form
array is inspected when looking for the field.A third bug is preventing the tests from completing:
This has been split off from the larger work of converting the OG Complex widget tests in #140, so that this important fix can go through without waiting for that mammoth task to complete. I have also cherry-picked the two commits from #147 that allow us to run functional tests on Travis.