Problem/Motivation

After uninstalling the ad content scheduler module, the menu link for scheduled ad content is still present and produces the following error when clicked:

Drupal\Core\Database\DatabaseExceptionWrapper: Exception in Scheduled Advertisements [ad_content_scheduler_scheduled_ad_content]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'unknown' in 'ORDER BY': SELECT "ad_content_field_revision"."revision_id" AS "revision_id", "ad_content_field_data_ad_content_field_revision"."id" AS "ad_content_field_data_ad_content_field_revision_id" FROM "ad_content_field_revision" "ad_content_field_revision" LEFT JOIN "ad_content_field_data" "ad_content_field_data_ad_content_field_revision" ON ad_content_field_revision.id = ad_content_field_data_ad_content_field_revision.id AND ad_content_field_data_ad_content_field_revision.langcode = ad_content_field_revision.langcode WHERE "ad_content_field_revision"."revision_id" IN (SELECT MAX(base_table.revision_id) AS "revision_id" FROM "ad_content_field_revision" "base_table" GROUP BY "base_table"."id") ORDER BY "unknown" ASC LIMIT 50 OFFSET 0; Array ( ) in main() (line 19 of index.php).

Drupal\views\ViewExecutable->execute() (Line: 1516)
Drupal\views\ViewExecutable->render() (Line: 201)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1692)
Drupal\views\ViewExecutable->executeDisplay() (Line: 80)
Drupal\views\Element\View::preRenderViewElement()
call_user_func_array() (Line: 107)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 871)
Drupal\Core\Render\Renderer->doCallback() (Line: 433)
Drupal\Core\Render\Renderer->doRender() (Line: 222)
Drupal\Core\Render\Renderer->render() (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 622)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 131)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray() (Line: 246)
Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}() (Line: 206)
Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (Line: 56)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (Line: 188)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 53)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 715)
Drupal\Core\DrupalKernel->handle() (Line: 19)

It is also still broken after reinstalling the ad content scheduler module and even produces errors on other pages, like:

Warning: Undefined array key "id" in Drupal\views\Plugin\ViewsHandlerManager->getHandler() (line 121 of core/modules/views/src/Plugin/ViewsHandlerManager.php).

on the Advertisements page because it probably cannot load the "Scheduled Advertisements" tab.

All in all, this basically broke parts of my test installation for good which is actually not good.

Steps to reproduce

  • Install the ad content scheduler module
  • Make an ad content scheduled
  • Uninstall the ad content scheduler module
  • Go to the broken menu link under Content -> Advertisements -> Scheduled Advertisements

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork ad-3537581

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

lrwebks created an issue. See original summary.

lrwebks’s picture

Priority: Normal » Major
Issue summary: View changes
lrwebks’s picture

Issue summary: View changes
anybody’s picture

@lrwebks I guess we need to re-export the view: https://git.drupalcode.org/project/ad/-/blob/11.x/modules/ad_content_sch...

Guess something changed in the data structure or field names so that the view broke?

anybody’s picture

@lrwebks: Regarding removing the view when uninstalling the module, see https://www.drupal.org/node/2404447
enforced: is the key.

anybody’s picture

Assigned: Unassigned » lrwebks
Status: Active » Needs work
anybody’s picture

#5 is done!

#4 is still needed to fix this!

lrwebks’s picture

Assigned: lrwebks » anybody

As just discussed, assigned to @anybody.

anybody’s picture

Status: Needs work » Needs review

Ok let's see if this works. Looking good locally.

anybody’s picture

Assigned: anybody » Unassigned
anybody’s picture

Status: Needs review » Reviewed & tested by the community

Great, all green! :) Let's merge this. Please reopen if further issues with the view should appear.

  • anybody committed 0388a54b on 11.x
    Issue #3537581 by anybody: Exception in Scheduled Advertisements [...
anybody’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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