Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@laceysanderson
Copy link
Member

Bug Fix

Issue #1964

Tripal Version: 4

Description

PR #1878 implemented hook_preprocess_field to preprocess the title field to allow it to render HTML tags in the title. Unfortunately this implementation made an assumption that turns out not to be true when you embed one entity inside another and the title of the embedded entity is a link 🙈 This is a bit of a pain to configure to demonstrate the issue...

Testing?

  1. Go to Tripal > Page Structure > Project > Manage fields and add a new field by clicking "Create a new field".
  2. Choose "Reference" as the type, add a label (e.g. "Organism") and choose "Other" for the type of content this field will reference.
  3. In the field/storage settings, choose "Tripal Content" as the "Type of item to reference", select "Organism" under Tripal Content Type" and set a term.
    image
  4. Then go to "Manage Display" for the project content type, and change the "Format" to "Rendered Entity" for the organism field you added.
  5. Next, go to "Manage Display" for the organism content type, click the gear beside the title and select "Link to the Tripal Content". Save these changes.
  6. Now that you've added/configured this field, create an organism page by going to Tripal > Content > "Add Tripal Content" > Organism. The values for your organism do not matter.
  7. Then create a project that references that organism by going to Tripal > Content > "Add Tripal Content" > Project, filling out the name with some html tags and choose the organism you created previously for the "Organism" field.
    image
  8. When you view the project page, on this branch, you will see both the titles changed appropriately. On the 4.x branch you will see an error.

On this branch

image

On 4.x

image

@laceysanderson laceysanderson linked an issue Sep 3, 2024 that may be closed by this pull request
@laceysanderson laceysanderson added bug - confirmed For issues where a core developer has confirmed a bug exists. Group 1 - Tripal Content Types | Terms | Fields Any issue relating to Tripal Content including types, terms, and fields. labels Sep 3, 2024
@laceysanderson laceysanderson self-assigned this Sep 3, 2024
Copy link
Contributor

@dsenalik dsenalik left a comment

Choose a reason for hiding this comment

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

Nice.

Removing original comment, I somehow did not have the branch updated 🙈

Copy link
Contributor

@dsenalik dsenalik left a comment

Choose a reason for hiding this comment

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

I updated the branch, and everything is working as advertised.
I set cardinality to unlimited and was able to have two linked organisms.

@laceysanderson
Copy link
Member Author

Thanks for the quick review @dsenalik!

@laceysanderson laceysanderson merged commit fffcbe7 into 4.x Sep 4, 2024
@laceysanderson laceysanderson deleted the tv4g1-1964-HTMLinTitleLink branch September 4, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug - confirmed For issues where a core developer has confirmed a bug exists. Group 1 - Tripal Content Types | Terms | Fields Any issue relating to Tripal Content including types, terms, and fields.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTML in title PR not comptible with Drupal Relationships field

2 participants