Skip to content

Commit

Permalink
Issue #3251169 by Owens-D: (v 3.2) Remove Droopler dependency on core…
Browse files Browse the repository at this point in the history
… Search module --author="lukasz.tyc <61900-lukasz.tyc@users.noreply.drupalcode.org>"

Issue #3251169 by Owens-D: (v 3.2) Remove Droopler dependency on core Search module
  • Loading branch information
lukasz-tyc-droptica committed Dec 22, 2023
1 parent 47ab178 commit fa1306b
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 34 deletions.
15 changes: 0 additions & 15 deletions config/install/user.role.anonymous.yml

This file was deleted.

15 changes: 0 additions & 15 deletions config/install/user.role.authenticated.yml

This file was deleted.

2 changes: 2 additions & 0 deletions droopler.features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ excluded:
- core.entity_form_mode.media.media_library
- image.style.thumbnail
- views.view.media
- user.role.anonymous
- user.role.authenticated
required: true
2 changes: 0 additions & 2 deletions droopler.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ dependencies:
- 'droopler:d_p_text_paged'
- 'droopler:d_p_text_with_bckg'
- 'droopler:d_p_tiles'
- 'droopler:d_search'
- 'droopler:d_social_media'
- 'droopler:d_update'
- 'drupal:block'
Expand Down Expand Up @@ -72,7 +71,6 @@ dependencies:
- 'drupal:page_cache'
- 'drupal:path'
- 'drupal:responsive_image'
- 'drupal:search'
- 'drupal:shortcut'
- 'drupal:system'
- 'drupal:taxonomy'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ type: module
core_version_requirement: ^10
version: DROOPLER_VERSION
dependencies:
- droopler:d_demo
- paragraphs:paragraphs
package: Droopler Common
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function d_content_init_init_field_alter(EntityInterface &$entity, string &$name
\Drupal::logger('d_content_init')
->error('Entity search returned no results in entity #@id of type "@type" (field "@field").', [
'@id' => $entity->id(),
'@type' => $entity->getEntityType(),
'@type' => $entity->getEntityType()->getLabel(),
'@field' => $name,
]);
}
Expand Down
5 changes: 4 additions & 1 deletion modules/custom/d_demo/d_demo.module
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ function d_demo_block_structure_alter(&$structure, $context) {
$structure['footer_others'] = ['file' => "$path/footer_others.yml"];
$structure['footer_secondary_menu'] = ['file' => "$path/footer_secondary_menu.yml"];
$structure['d_social_media_footer'] = ['file' => "$path/d_social_media_footer.yml"];
$structure['header_search_link'] = ['file' => "$path/header_search_link.yml"];
$structure['secondary_menu'] = ['file' => "$path/secondary_menu.yml"];
$structure['bottom_footer_menu'] = ['file' => "$path/bottom_footer_menu.yml"];

if (\Drupal::moduleHandler()->moduleExists('d_search')) {
$structure['header_search_link'] = ['file' => "$path/header_search_link.yml"];
}
}
}

Expand Down
1 change: 1 addition & 0 deletions modules/custom/d_product/d_product.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies:
- 'droopler:d_p_text_paged'
- 'droopler:d_p_text_with_bckg'
- 'droopler:d_p_tiles'
- 'droopler:d_search'
- 'drupal:block'
- 'drupal:field'
- 'drupal:file'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ version: DROOPLER_VERSION
package: Droopler Common

dependencies:
- droopler:d_demo
- droopler:d_product
16 changes: 16 additions & 0 deletions modules/custom/d_search/d_search.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* @file
* Update function for d_search.
*/
declare(strict_types = 1);
use Drupal\user\RoleInterface;
/**
* Implements hook_install().
*/
function d_search_install(): void {
if (\Drupal::moduleHandler()->moduleExists('search')) {
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['search content']);
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['search content']);
}
}

0 comments on commit fa1306b

Please sign in to comment.