Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
Interacting with entity storage should never use raw SQL, as there is no guarantees about the schema of the table.
It should instead use the entity query API
Edit: this is actually dead code, there's no calls to it, so we can remove it.
Steps to reproduce
Proposed resolution
Use entity queries instead of raw SQL
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork sitewide_alert-3261638
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
Comment #2
larowlanComment #4
larowlanComment #5
larowlanComment #6
ChrisSnyderI don't think all of this code is dead. For example,
\Drupal\sitewide_alert\Controller\SitewideAlertController::revisionOverview
, makes a call to\Drupal\sitewide_alert\SitewideAlertStorage::revisionIds
. There may be some additional refactoring to remove the SitewideAlertStorage classComment #7
larowlanIndeed, you're correct.
Added some tests and it fails as expected
Reworking
Comment #8
larowlanPushed some code to use the entity query API (use of raw SQL for entities is not supported), tests now passing.
Comment #9
ChrisSnyderComment #10
ChrisSnyder