Skip to content
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

Issue #3415090 by nkoporec: SocialProfileTagSplitWidget is not being rendered if the #options is empty #3704

Conversation

nkoporec
Copy link
Contributor

Problem

We want to programetically render a form that contains that uses the SocialProfileTagSplitWidget widget, the #options array is populated later (after rendering the initial form). The problem is that the field is not being rendered correctly as within the widget we are returning an empty array if there are no #options. I think this should not be the case and the widget should return the basic structure of the element.

Solution

Don't return an empty array if the #options are empty but rather return the already build element array.

Issue tracker

https://www.drupal.org/project/social/issues/3415090

Theme issue tracker

How to test

  1. Create a form that uses SocialProfileTagSplitWidget
  2. Try to render the form programetically but don't populate the #options of the widget.
  3. Render the form and check if the widget is rendered.

Definition of done

Before merge

  • Code/peer review is completed
  • All commit messages are clear and clean. If applicable a rebase was performed
  • All automated tests are green
  • Functional/manual tests of the acceptance criteria are approved
  • All acceptance criteria were met
  • New features or changes to existing features are covered by tests, either unit (preferably) or behat
  • Update path is tested. New hook_updates should respect update order, right naming convention and consider hook_post_update code
  • Module can be safely uninstalled. Update/implement hook_uninstall and make sure that removed configuration or dependencies are removed/uninstalled
  • This pull request has all required labels (team/type/priority)
  • This pull request has a milestone
  • This pull request has an assignee (if applicable)
  • Any front end changes are tested on all major browsers
  • New UI elements, or changes on UI elements are approved by the design team
  • New features, or feature changes are approved by the product owner

After merge

  • Code is tested on all branches that it has been cherry-picked
  • Update hook number might need adjustment, make sure they have the correct order
  • The Drupal.org ticket(s) are updated according to this pull request status

Screenshots

Release notes

Change Record

Fixed an issue with SocialProfileTagSplitWidget when the widget was not being rendered correctly if the #options were empty.

Translations

@nkoporec nkoporec added type: bug Fixes a bug in Open Social status: needs review This pull request is waiting for a requested review prio: medium team: guardians labels Jan 16, 2024
@nkoporec nkoporec added this to the 12.0.4 milestone Jan 16, 2024
Copy link

mergeable bot commented Jan 16, 2024

Thanks for contributing towards Open Social! A maintainer from the @goalgorilla/maintainers group might not review all changes from all teams/contributors. Please don't be discouraged if it takes a while. In the meantime, we have some automated checks running and it might be that you will see our comments with some tips or requests to speed up the review process. 😊

@ronaldtebrake ronaldtebrake modified the milestones: 12.0.4, 12.0.5 Jan 18, 2024
@BiaInacio
Copy link
Contributor

Organization tag and interests fields are working as expected on registration form!

image

@ronaldtebrake ronaldtebrake modified the milestones: 12.0.5, 12.0.6, 12.0.7, 12.0.8 Jan 25, 2024
@ronaldtebrake ronaldtebrake modified the milestones: 12.0.8, 12.0.9 Feb 13, 2024
Copy link
Contributor

@vcsvinicius vcsvinicius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I Approved

@nkoporec nkoporec merged commit 0036adf into main Feb 15, 2024
189 checks passed
@nkoporec nkoporec deleted the issue/3415090/socialprofiletagsplitwidget-is-not-rendering-correctly branch February 15, 2024 13:42
@nkoporec
Copy link
Contributor Author

🍒 picked to 12.0.x, 12.1.x and 12.2.x

@ronaldtebrake ronaldtebrake added the backport: verified This pull request has been back ported to an older minor version label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport: verified This pull request has been back ported to an older minor version prio: medium status: needs review This pull request is waiting for a requested review team: guardians type: bug Fixes a bug in Open Social
Development

Successfully merging this pull request may close these issues.

4 participants