Problem/Motivation
Started when I got this error restoring a dump file of a linkchecker enabled site:
ERROR 1227 (42000) at line 2928: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
line 2928 of my dump file has this:
/*!50003 CREATE*/ /*!50017 DEFINER="myclientnameqa"@"localhost"*/ /*!50003 TRIGGER linkchecker_link_der_insert BEFORE insert ON linkchecker_link FOR EACH ROW SET NEW.entity_id__target_id_int = IF(NEW.entity_id__target_id REGEXP '^[0-9]+$', CAST(NEW.entity_id__target_id AS UNSIGNED), NULL) */;;
In order to load the database without a permissions error I had to remove this line and one other similar line.
BACKGROUND INFORMATION:
Since I installed linkchecker I get problems reloading database dumps.
linkchecker requires dynamic_entity_reference , this adds database triggers which require elevated privileges to restore from a dump file
Uninstalling linkchecker and dynamic_entity_reference does not solve the problem because one of these modules doesn't clean up after it'self.
Steps to reproduce
Install linkchecker using the following patches and linkchecker version: 8.x-1.0-alpha1 :
"drupal/linkchecker": {
"Extraction status":
"https://www.drupal.org/files/issues/2020-12-08/3184613-extraction-status.patch",
"Broken links view should not show status code -1":
"https://www.drupal.org/files/issues/2020-12-17/3118914-4.patch",
"Update empty value for last_check field on broken links report":
"https://www.drupal.org/files/issues/2020-12-25/3112537-12.patch",
"Auto-select extractor if there is only one available":
"https://www.drupal.org/files/issues/2020-12-18/3133925-2.patch",
"Undefined offset error":
"https://www.drupal.org/files/issues/2020-08-24/undefined-offset-error-3065045-13.patch"
},
Then use linkchecker to scan your site for links, dump your db and restore this dump to another database.
Proposed resolution
Remove dependency on dynamic_entity_reference?
provide documentation on workaround? Or , remove dynamic_entity_reference.
Remaining tasks
review
API changes
rather than rely on triggers, find another solution.
Data model changes
see API changes, find a solution that does not require triggers/ dynamic_entity_reference module.