Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Steps to reproduce:
- Edit new users view
- Add field, filter by user, select permissions
- Click save
- Place the block in your frontpage
The admin user shows:
<div class="views-field views-field-permission"><span class="field-content">, View published content, Use the <a href="/admin/config/content/formats/manage/basic_html">Basic HTML</a> text format, View comments, Post comments, Skip comment approval, [...]</span></div>
See the trailing comma.
Proposed resolution
Fix the filter format permission name.
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#6 | 2354493-6.patch | 1.62 KB | penyaskito |
#6 | 2354493-6.test-only.patch | 1.11 KB | penyaskito |
#4 | 2354493-filter-name-4.patch | 517 bytes | penyaskito |
Comments
Comment #1
penyaskitoComment #2
penyaskitoComment #3
penyaskitoThis has to do with escaping the title of the permission, which contains html:
I checked that the trailing comma is just the consequence, not the symptom. The "use plain text format" permission comes without the title because of this issue, and then is not found on the permissions array when looking for the title.
Comment #4
penyaskitoThis fixes the issue, let's see what the bot things.
Comment #5
penyaskitoComment #6
penyaskitoNow with a test.
Comment #8
penyaskitoFrom
FilterFormatInterface
:but it does not say why, and all tests are green.
Comment #9
penyaskitoComment #10
jhedstromIf this change is made, does the permission now appear on the permissions page (I'm guessing that's why it was originally returning FALSE)?
Comment #11
penyaskitoYes, with the patch applied it is shown in the permissions page. By default it will be "Use plain text format".
Patch still applies. We need to define if this is currently a bug, and if not, my guess is that it should be better documented why are we doing this.
Comment #22
quietone CreditAttribution: quietone at PreviousNext commentedI tested this on 10.0.x, standard install, and was not able to reproduce this error. I followed the steps given in the Issue Summary. This is what the block displays for the admin user and I don't see an trailing comma.
<div class="views-field views-field-permission"><span class="field-content">View comments, View published content, Use shortcuts, Use the site-wide contact form, Post comments, Use search, Skip comment approval, Use the <a href="/admin/config/content/formats/manage/basic_html">Basic HTML</a> text format</span></div>
Therefore, closing as cannot reproduce. If you are experiencing this problem on a supported version of Drupal reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue (starting from "Install Drupal core").
Thanks!