8000 Fix issue with demo content taxonomy names by chriswales95 · Pull Request #97 · localgovdrupal/localgov_elections · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix issue with demo content taxonomy names #97

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

Merged
merged 3 commits into from
Jul 4, 2024

Conversation

chriswales95
Copy link
Member

Should close #91.

What this PR does:

  1. Removes brackets from demo content party names
  2. Adds warning to taxonomy page for party name in party taxonomy page
  3. Adds warning to candidate party autocomplete field widget
  4. Adds a patch so the help text appears on autocomplete deluxe widget

@chriswales95 chriswales95 self-assigned this Jul 3, 2024
@chriswales95 chriswales95 changed the title Feature/demo taxonomy fix Fix issue with demo content taxonomy names Jul 3, 2024
@finnlewis
Copy link
Member

This reverts a commit I made to rename the demo content taxonomy names: dae0f9f

This was done because people testing were confused about the duplicate parties when enabling the demo content and the UK parties module.

I can't find the original issue, maybe it was in Slack?

Either way, I think we need a way for user to distinguish between demo taxonomy terms and those generated by the UK parties module.

But more fundamentally, I wonder why are brackets a problem in taxonomy term names in this instance.

@chriswales95
Copy link
Member Author

@finnlewis Ah I wasn't aware.

Basically, entity references fields usally have stuff in the form entity title (entity id). It must do some pattern matching with the brackets. When I looked in xdebug in the form state, it had arrays in the form of (just making this up but it's close enough) [ field_value => [ "target_id" => "demo content"] ] for taxonomy names like "Labour (demo content)".

Mabye square brackets would work?

@markconroy
Copy link
Member

Handiest might be to change the names to Labour - demo content instead of Labour (demo content)

@chriswales95
Copy link
Member Author

@markconroy That's sensible. I'll make the change soon.

@chriswales95
Copy link
Member Author

I did try and do some validation in the form validation hook but could not get the full text from the input :/. It would be good to revisit that at some point as well.

@chriswales95 chriswales95 requested a review from markconroy July 4, 2024 11:48
@chriswales95
Copy link
Member Author
chriswales95 commented Jul 4, 2024

@markconroy @finnlewis @dedavidson Switched to using the dashes. @finnlewis this should fix your problem.

@finnlewis
Copy link
Member

Testing, thanks @chriswales95 !

Copy link
Member
@finnlewis finnlewis left a comment

Choose a reason for hiding this comment

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

Works better now, thanks @chriswales95 !

@finnlewis finnlewis merged commit 5d8ae99 into 1.x Jul 4, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Candidate saving breaks if party taxonomy title has a bracket in it
3 participants
0