Problem/Motivation

Three views shipped by Commerce use format: basic_html for their empty-text area. basic_html is created by the Standard install profile only; sites
built on the Minimal profile or Drupal CMS do not have it. The views do not declare a dependency on filter.format.basic_html, so they install without error.

When the empty text renders, \Drupal\filter\Element\ProcessedText finds no format, logs Missing text format: basic_html at alert level and renders an
empty string. Customers with no orders see a blank space instead of "You have not placed any orders with us yet.", and every such page view adds an alert to the log.

Affected config:

  • modules/order/config/install/views.view.commerce_user_orders.yml
  • modules/promotion/config/install/views.view.commerce_promotions.yml
  • modules/promotion/config/install/views.view.commerce_promotion_coupons.yml

All three empty texts are a single plain sentence, so they need no HTML filtering.

Steps to reproduce

  1. Install Drupal with the Minimal profile (or Drupal CMS).
  2. Enable Commerce Order (and Commerce Promotion for the other two views).
  3. As a customer with no orders, visit /user/{uid}/orders.
  4. The empty text is missing, and the log has "Missing text format: basic_html".

Proposed resolution

Use plain_text in the three views. It is the fallback format and always exists.

Existing sites keep their installed views. A post-update could switch the format to plain_text only where basic_html does not exist, leaving
Standard-profile sites untouched. Maintainers to decide whether that is wanted.

Remaining tasks

  • MR changing the three views to plain_text.
  • Decide on the post-update for existing sites.
  • Test: install the views on a site without basic_html and assert the empty text renders.

User interface changes

The empty texts render again on sites without basic_html.

API changes

None.

Data model changes

Config only: the empty-text format of three views.

Issue fork commerce-3372257

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

MacSim created an issue. See original summary.

macsim’s picture

Issue summary: View changes
macsim’s picture

Issue summary: View changes
zaporylie’s picture

Version: 8.x-2.36 » 3.x-dev
Component: Discount » Developer experience
Issue summary: View changes

Rescoping: the coupons view is one of three Commerce views that hard-code the basic_html text format, which only the Standard install profile creates.
Minimal-profile sites and Drupal CMS have no such format.

All three use it for a plain-sentence empty text, and none declares a dependency on filter.format.basic_html, so they install fine and break at render time.
ProcessedText logs Missing text format: basic_html at alert level and renders an empty string, so customers see a blank space instead of the message:

  • modules/order/config/install/views.view.commerce_user_orders.yml: "You have not placed any orders with us yet." on a customer's orders page.
  • modules/promotion/config/install/views.view.commerce_promotions.yml
  • modules/promotion/config/install/views.view.commerce_promotion_coupons.yml: the case reported here.

These are the only basic_html references in 3.x (config and code). Updated the title and summary to cover all three, and moved to 3.x-dev.

zaporylie’s picture

Status: Active » Needs review
macsim’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the description update and MR
Code looks good to me, tests provided, no more error message on a fresh minimal install
RTBC

jsacksick made their first commit to this issue’s fork.

  • jsacksick committed 45061303 on 3.x authored by zaporylie
    fix: #3372257 Missing text format: basic_html
    
    By: macsim
    By: zaporylie...
jsacksick’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.