- Issue created by @danrod
- 🇨🇦Canada danrod Ottawa
I'm also seeing this issue when creating a new content type and adding any field type.
The fix is to check if
$currentPath
contains the string/admin/structure/types/manage/
if so, just add areturn
instruction and not execute the rest of the hook function:/** * Implements hook_form_FORM_ID_alter(). */ function copyscape_form_field_config_edit_form_alter(&$form, FormStateInterface $form_state, $form_id) { $currentPath = \Drupal::service('path.current')->getPath(); $pathParts = explode('/', $currentPath); $lastPart = $pathParts[count($pathParts) - 1]; [$entityType, $bundle, $field] = explode('.', $lastPart); if ($entityType !== 'node') { return; } /** @var \Drupal\copyscape\Copyscape\Utility $utility */ $utility = \Drupal::service('copyscape.utility'); $fieldChecked = $utility->isCopyscaped($bundle, $field);
- Merge request !11Issue # 3517927: Added condition to check if the admin/user is not in the... → (Merged) created by danrod
- 🇨🇦Canada danrod Ottawa
I added the condition in the MR https://git.drupalcode.org/project/copyscape/-/merge_requests/11 and it seems to have fixed the issue, I'll move it to "Needs Review", any novice user wants to test this?
- 🇨🇦Canada danrod Ottawa
I'll move it to "Fixed" since it's a small change, if there's questions, please let me know and I'll re-open the task.