Problem/Motivation

When enabling the option 'Force using fields' in the Views display options, this has no effect other then enabling the fields options. These fields are never actually rendered, nor do any of the options set for these fields (like rewriting) have any effect.

Steps to reproduce:
- Create a Content view
- Set format to Format:Unformatted list
- Set Show:Content | Teaser
- In the Format settings enable 'Force using fields'
- The Preview will show teasers, not fields

Proposed resolution

Make the option work

Remaining tasks

- find a fix
- add tests (it has zero test coverage currently)

User interface changes

none

API changes

none

Data model changes

none

Original report

"Rewrite results" working in Drupal 8.2.2 views but "Rewrite results" not working in Drupal 8.2.3 views

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mahapatra.tusar created an issue. See original summary.

cilefen’s picture

Title: Rewrite results » Rewrite results not working in 8.2.3.
Status: Active » Postponed (maintainer needs more info)

I just tried a rewrite and it works. Would you please export the affected view and attach it?

mahapatra.tusar’s picture

Yes.. it is working when view is Table format but not working unformated list format.
For export can I use view export module with Csv_serialization module.

cilefen’s picture

I just tested a rewrite with an unformatted list and it works. Would you please export the affected view and attach it? Use the configuration export at admin/config/development/configuration/single/export.

mahapatra.tusar’s picture

I have attached here, if it is wrong then please advice.

cilefen’s picture

Assigned: mahapatra.tusar » Unassigned
Status: Postponed (maintainer needs more info) » Active
Lendude’s picture

Status: Active » Postponed (maintainer needs more info)
row:
   type: 'entity:node'
   options:
       view_mode: teaser

Well in this view, Node teasers are shown, so all field settings will be ignored. Does it work if you show fields?

mahapatra.tusar’s picture

I have removed hidden fields to show fields, but not working.

chrotto’s picture

FileSize
18.94 KB

Have the same problem on the latest version 8.3.7.
Using Unformatted list forcing use of fields and just want to rewrite the output of a date field like this:

<p><strong>{{ field_startar }}</strong></p>

Nothing happens with the field output.
If I copy this view display and change the format to Table the output works as aspected.
Have attached the view.

Lendude’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)
      style:
        type: views_bootstrap_table

This is not a core display type (I'm assuming it's from https://www.drupal.org/project/views_bootstrap), and you say that if you change it to a core display type it works, so this doesn't seem to be a core bug, please file an issue with the contrib module.

Closing this for now since all reported problems don't seem to stem from core.

chrotto’s picture

This is not the problem.
When I changed Using Unformatted list forcing use of fields and Show Content
to
Using Unformatted list, Force using fields unchecked and Show fields
The view behaved as expected.

Lendude’s picture

Title: Rewrite results not working in 8.2.3. » 'Force using fields' option in display options doesn't make a View render fields
Version: 8.2.3 » 8.4.x-dev
Issue summary: View changes
Status: Closed (works as designed) » Active
Issue tags: -Needs steps to reproduce

@chrotto ah! ok so the problem stems from using 'Force using fields' in the display options.

Tried using that, but it doesn't seem to do anything, it just keeps showing the teaser, not the fields that I add. So it's not just the rewrite that doesn't work, it's that this entire option seems to be broken.

Updated the IS to reflect what I thin k is the real problem.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
atrevetemen.adm’s picture

Hello,
Has this issue been fixed? I am in version 9.3.8 and I still can see the issue: The 'Force using fields' option does not work other that for the table view mode. I am trying to add additional fields using the 'Force using fields' option from the view designer but the fields are not shown for presentation modes List and HTML List.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

larowlan’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative

I wonder why you're using the display content option - if you want fields, why not use the fields display?

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.