Problem/Motivation

When enabling Workspaces module, blocks that include media images do not appear on the page.

Screenshot of missing Umami custom block that contain media image -

Steps to replicate:

  1. Install Demo Umami install profile
  2. Enable Workspaces and Workspaces UI modules
  3. Switch to the stage workspace /admin/config/workflow/workspaces/manage/stage/activate
  4. Edit the Hero block /en/admin/content/block/3
  5. Deploy content /admin/config/workflow/workspaces/manage/stage/publish

Unable to reproduce on 11.x, workspace publishes without error and blocks remain on homepage

You will get an error -
Deployment failed. All errors have been logged.
(but no errors appear in the Recent errors log page /en/admin/reports/dblog)

It gets more interesting...
If you edit a node in stage, save it, and now click on 'deploy content', the deployment will be successful!
wait. what?

:)

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

shaal created an issue. See original summary.

shaal’s picture

Issue summary: View changes
StatusFileSize
new951.97 KB
jerdavis’s picture

I can confirm. I'm curious what is triggering this issue or if this is being looked into.

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.

mandclu’s picture

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

I've been testing workspaces with Umami in Drupal 9.2 and can still reproduce this problem. In my testing, as soon as you switch to any workspace besides "Live" these custom blocks fail to display. For Umami this includes the hero blocks on both the home page and recipes page.

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

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

dqd’s picture

Component: workspaces.module » block_content.module
Priority: Major » Normal

Screenshot of missing Umami custom block that contain media image

That(!) made me think because of custom block ...

I can confirm and reproduce this issue using a media field in a custom block type with the Drupal Bootstrap5 theme and tried to investigate further to prevent us to look on the wrong places. First idea which came into mind is what if some themes hook into and breaking media references by calling content. I remember I had such issues on custom themes back in D7 days so I started to switch themes (no workspaces module involved), and viola! Turns out that the media field images in a custom block appear on standard Bartik theme, on classic Danland theme, on classic Drupal Bootstrap 3 theme, on Cornerstone base theme, on Fepper theme. And now it gets interesting because on Drupal Bootstrap Barrio it appears only in certain regions and it get rid off completely on Bootstrap5.

I sadly cannot test on umami theme (as stated above) on different regions since umami is not included no more on Drupal 9 but anyone who can test this for OT on different regions with and without workspaces we can come closer to the reason of that issue and if it is maybe theme related (moving it to the respective issue queues then) or core theme layer related or still core block layer related how it hands over to themes.

But we can say for now that it is not a workspace related but rather block.content module related issue I think. Because I had no workspace module in place nor activated on this test. Maybe the OT can retest occurrence without workspaces module because maybe he just accidently thought it happened with workspaces by chance. And even IF it happens with workspaces activated it does not need to be the reason.

I will deescalate the issue prio because there is no major functionality broken and there are several work-arounds available to get media images into blocks (Views block for example).

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

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now 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.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now 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.

Version: 10.1.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, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Active » Postponed (maintainer needs more info)

Wasn't able to replicate this issue. Wonder if someone could confirm it's still an issue in D10?

mandclu’s picture

I just did a fresh install of Umami on Drupal 10.0.9. As soon as I switch to the Stage workspace the umami_views_block__promoted_items_block_1 and umami_banner_home blocks on the home page disappear.

nlisgo’s picture

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

I am able to recreate this but in the steps to replicate I change:

/admin/config/workflow/workspaces/manage/stage/deploy

to:

/admin/config/workflow/workspaces/manage/stage/publish?destination

nlisgo’s picture

Issue summary: View changes

For some reason I need to add the desitination parameter or I get a WSOD. I will raise a separate issue for that.

nlisgo’s picture

I created an issue to address the fact that we are not logging the error. #3376177

When I surface the error this is what I get:

NOTICE: PHP message: Uncaught PHP Exception Drupal\Core\Database\DatabaseExceptionWrapper: "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')
GROUP BY "base_table"."revision_id", "base_table"."id") "subquery"' at line 7: SELECT COUNT(*) AS "expression"
FROM
(SELECT 1 AS "expression"
FROM
"content_moderation_state_revision" "base_table"
INNER JOIN "content_moderation_state_field_revision" "content_moderation_state_field_revision" ON "content_moderation_state_field_revision"."revision_id" = "base_table"."revision_id"
WHERE ("content_moderation_state_field_revision"."content_entity_revision_id" IN (:db_condition_placeholder_0)) AND ()
GROUP BY "base_table"."revision_id", "base_table"."id") "subquery"; Array
(
    [:db_condition_placeholder_0] => 5
)
" at /data/app/core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php line 46
{ "timestamp": "2023-07-22T13:22:21+0000", "fields": { "client_ip": "-", "remote_addr": "127.0.0.1", "remote_user": "", "request_uri": "/en/admin/config/workflow/workspaces/manage/stage/publish?destination=", "status": "500", "body_bytes_sent": "184", "request_time": "0.373", "http_referrer": "http://localhost:8080/en/admin/config/workflow/workspaces/manage/stage/publish?destination", "http_user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36", "request_id": "-", "cpu": "56.36", "memory": "10485760", "headers": { "Cache-Control": "must-revalidate, no-cache, private"} } }

The error is caused by the empty condition:

WHERE ("content_moderation_state_field_revision"."content_entity_revision_id" IN (:db_condition_placeholder_0)) AND ()

I've tried to get to the bottom of where the empty condition originates and the intention behind it but it's proving difficult for me.

acbramley’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

I've tested this on latest core and cannot reproduce the error. The steps in the IS are quite outdated though, I've updated them with the required steps.

Will leave this open a touch longer, I assume this was an issue in workspaces rather than block_content though.

smustgrave’s picture

Just following up if anyone has been able to update in latest D11?

acbramley’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing out as it's been 3 months since #16

If you are able to reproduce this issue, please feel free to reopen with the steps to reproduce.