Skip to content
Snippets Groups Projects
Unverified Commit 691df565 authored by Robert Ragas's avatar Robert Ragas Committed by GitHub
Browse files

Merge pull request #18 from goalgorilla/feature/fatal-error-on-deletion-3104081

Issues #3104081: Removed strict check parameter of array_search to not check the types of arguments.
parents 1f5235bb 88dc4f44
No related branches found
Tags 8.x-2.9
No related merge requests found
......@@ -1548,7 +1548,7 @@ function social_course_remove_material_from_courses(int $material_id): void {
/** @var \Drupal\Core\Field\EntityReferenceFieldItemListInterface $section_content */
$materials = $section_content->getValue();
// Find the index of the material in this field.
$idx = array_search($material_id, array_column($materials, 'target_id'), TRUE);
$idx = array_search($material_id, array_column($materials, 'target_id'));
$section_content->removeItem($idx);
$section->save();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment