open_social
open_social copied to clipboard
Issue #3313504 by vnech: Make "basic_html" text format as default for "text" and "text_long" field types
Problem
The post field field_post with the text doesn't allows to user to choose text format. After submitting this field gets the most higher text format in the list from admin/config/content/formats.
That means that the posts can have text with different text format and, as a result, different text displaying.
This also create an issue with mentions if I add some custom text format with the highest weight like this:
Mentions in post:
Solution
- Make
basic_html
as a default text format fortext
andtext_long
field types
Issue tracker
- https://www.drupal.org/project/social/issues/3313504
- https://getopensocial.atlassian.net/browse/PROD-22258
Theme issue tracker
n/a
How to test
- [ ] Login as an admin
- [ ] Add a new text format and make it the highest weight on admin/config/content/formats
- [ ] Create a post with mentions
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
n/a
Release notes
Make basic_html
as a default text format for text
and text_long
field types.
Change Record
n/a
Translations
n/a
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. :blush:
Hi @nechai, This fix looks good to me, but I am wondering if we need to write update hook to fix those Posts which might have wrong text format. For example see this snapshot from our Demo site:
I also noticed similar issue for Comments, but not sure if it need to fix it in this or different PR.
@tbsiqueira, @navneet0693 Could you please check this issue and provide your input? We can also fix it in our Badge module, but it can be more stable if we fix it in Distro.
Hi @ribel! Seems like we have this issue with any of text
and text_long
field types.
I suggest to specify basic_html
text format as default for these field types if explicitly the text format was not chosen by users from ui.
@nechai I am not sure if we need to hardcode it for ALL text
and text_long
field types, because other Open Social might have their own text formats for reason.
So I think it's actually better to limit it only for our Comments and Posts (where we have Mentions functionality).
@nechai Please resolve the failing tests.
I think this PR can be closed, since we fixed issue in related extension: https://github.com/goalgorilla/cablecar/pull/120