9 Commits
stag ... stage

18 changed files with 173 additions and 32 deletions

2
.gitignore vendored
View File

@ -7,6 +7,8 @@
/web/profiles/contrib/
/web/libraries/
web/modules/dev/*.tar.gz
# Ignore sensitive information
/web/sites/*/settings.php
/web/sites/*/settings.local.php

View File

@ -18,6 +18,7 @@
"require": {
"php": ">=7.3",
"composer/installers": "^1.2",
"drupal/admin_theme": "1.x-dev@dev",
"drupal/advagg": "4.x-dev@dev",
"drupal/amswap": "^3.0",
"drupal/audiofield": "^1.10",

52
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "b16797b72316e983c9d3ffdc0c169447",
"content-hash": "e531ede696593276a00fff574ba79824",
"packages": [
{
"name": "alchemy/zippy",
@ -2654,6 +2654,55 @@
"source": "https://git.drupalcode.org/project/address"
}
},
{
"name": "drupal/admin_theme",
"version": "dev-1.x",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/admin_theme.git",
"reference": "1e3555135dab4bcab3924b876dac0b8bc9540e8e"
},
"require": {
"drupal/core": "^8 || ^9",
"php": ">=5.5.9"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-1.x": "1.x-dev"
},
"drupal": {
"version": "8.x-1.0-beta1+1-dev",
"datestamp": "1599619343",
"security-coverage": {
"status": "not-covered",
"message": "Dev releases are not covered by Drupal security advisories."
}
}
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0+"
],
"authors": [
{
"name": "geek-merlin",
"homepage": "https://www.drupal.org/user/229048"
},
{
"name": "justy",
"homepage": "https://www.drupal.org/user/115811"
}
],
"description": "Enable the administration theme on more paths than possible with Drupal's default administration page.",
"homepage": "https://www.drupal.org/project/admin_theme",
"keywords": [
"drupal"
],
"support": {
"source": "https://git.drupalcode.org/project/admin_theme"
}
},
{
"name": "drupal/admin_toolbar",
"version": "3.0.1",
@ -20687,6 +20736,7 @@
],
"minimum-stability": "dev",
"stability-flags": {
"drupal/admin_theme": 20,
"drupal/advagg": 20,
"drupal/auto_entitylabel": 20,
"drupal/commerce_license": 20,

View File

@ -0,0 +1,4 @@
paths: "/dummy-path-needed-until-core-issue-2930364-is-fixed\r\n/user/*/*"
exclude_paths: /dummy-path-needed-until-core-issue-2930364-is-fixed
_core:
default_config_hash: djrGnpQFw2Jm0GjIQ-o28-09ZKtCusE5k0VNddWmOKE

View File

@ -1,6 +1,7 @@
module:
actions_permissions: 0
address: 0
admin_theme: 0
admin_toolbar: 0
admin_toolbar_links_access_filter: 0
advagg: 0

View File

@ -5,9 +5,11 @@ dependencies:
module:
- search_api_solr
- taxonomy
- synonyms
- search_api
- materio_sapi
config:
- field.storage.taxonomy_term.field_synonyms
- search_api.server.database_search_autocomplete
third_party_settings:
search_api_solr:
@ -15,7 +17,7 @@ third_party_settings:
commit_before_finalize: false
commit_after_finalize: false
multilingual:
limit_to_content_language: false
limit_to_content_language: true
include_language_independent: true
highlighter:
maxAnalyzedChars: 51200
@ -43,23 +45,31 @@ third_party_settings:
maxntp: 2000
boost: false
interestingTerms: none
term_modifiers:
slop: 10000000
fuzzy: 2
advanced:
index_prefix: ''
collection: ''
timezone: ''
term_modifiers:
slop: 10000000
fuzzy: 2
id: autocomplete
name: 'autocomplete taxonomy'
description: ''
read_only: false
field_settings:
field_synonyms:
label: Synonyms
datasource_id: 'entity:taxonomy_term'
property_path: field_synonyms
type: 'solr_text_custom:edgestring'
dependencies:
config:
- field.storage.taxonomy_term.field_synonyms
name:
label: Name
datasource_id: 'entity:taxonomy_term'
property_path: name
type: 'solr_text_custom:ngram'
type: 'solr_text_custom:edgestring'
boost: !!float 2
dependencies:
module:
@ -72,6 +82,14 @@ field_settings:
dependencies:
module:
- taxonomy
synonyms:
label: 'Synonyms list'
datasource_id: 'entity:taxonomy_term'
property_path: synonyms
type: 'solr_text_custom:ngram'
dependencies:
module:
- synonyms
tid:
label: 'Term ID'
datasource_id: 'entity:taxonomy_term'
@ -106,6 +124,8 @@ processor_settings:
boosts:
'entity:taxonomy_term':
datasource_boost: !!float 1
bundle_boosts:
thesaurus: !!float 2
weights:
preprocess_index: 0
tracker_settings:

View File

@ -42,8 +42,10 @@ class ComputedArticlesReferences extends EntityReferenceFieldItemList
->range(0,12)
->condition('type', 'article');
$nids = $query->execute();
foreach ($nids as $key => $nid) {
$this->list[$key] = $this->createItem($key, $nid);
$i = 0;
foreach ($nids as $nid) {
$this->list[$i] = $this->createItem($i, $nid);
$i++;
}
}

View File

@ -42,8 +42,10 @@ class ComputedCommerceProductReferences extends EntityReferenceFieldItemList
// ->condition('type', 'article')
->range(0,12);
$ids = $query->execute();
foreach ($ids as $key => $id) {
$this->list[$key] = $this->createItem($key, $id);
$i = 0;
foreach ($ids as $id) {
$this->list[$i] = $this->createItem($i, $id);
$i++;
}
}

View File

@ -41,14 +41,16 @@ class ComputedMaterialsReferences extends EntityReferenceFieldItemList
->condition('status', 1)
->condition('type', 'materiau')
->exists('field_materiau_images')
->condition('field_materiau_images.%delta', 3)
->condition('field_materiau_images.%delta', 3, '>')
->sort('created', 'DESC')
->range(0,200);
$results = $query->execute();
if ($results) {
$nids = array_rand($results, 70);
foreach ($nids as $key => $nid) {
$this->list[$key] = $this->createItem($key, $nid);
$nids = array_rand($results, 100);
$i = 0;
foreach ($nids as $nid) {
$this->list[$i] = $this->createItem($i, $nid);
$i++;
}
}
}

View File

@ -45,11 +45,13 @@ class ComputedShowroomsReferences extends EntityReferenceFieldItemList
$tids = $query->execute();
shuffle($tids);
foreach ($tids as $key => $tid) {
$i=0;
foreach ($tids as $tid) {
$term = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($tid);
$sid = WorkflowManager::getCurrentStateId($term, 'field_workflow');
if($sid != 'workflow_visible') continue;
$this->list[$key] = $this->createItem($key, $tid);
$this->list[$i] = $this->createItem($i, $tid);
$i++;
}
}

View File

@ -115,9 +115,14 @@ class D7FlagListsMaterio extends SqlBase {
// limit folder name to 32 characters (32 bytes, special chars like é use 2 bytes)
$title = $row->getSourceProperty('title');
// drush_print("\n".'Title ' . $title);
$title = $this->remove_accents($title);
if (mb_strlen($title) > 32) {
$title = mb_strcut($title, 0 , 28).'...';
$title = preg_replace("/\s+/", " ", $title);
// drush_print("\t" . strlen($title));
if (strlen($title) > 25) {
// drush_print("\t".$title);
$title = mb_strcut($title, 0 , 25);
// drush_print("\t".$title);
}
$row->setSourceProperty('title', $title);

View File

@ -150,7 +150,7 @@ class D7UcRolesLicense extends DrupalSqlBase {
$last_order = $first_order;
}
drush_print(print_r($last_order, true));
// drush_print(print_r($last_order, true));
// put the right product variation web OR web-showroom
switch($last_order['model']){
case "abo01-A":
@ -163,7 +163,7 @@ class D7UcRolesLicense extends DrupalSqlBase {
}
if(isset($product_variation_id)){
drush_print($row->getSourceProperty('mail').' product_variation_id: '.$product_variation_id);
// drush_print($row->getSourceProperty('mail').' product_variation_id: '.$product_variation_id);
$row->setSourceProperty('product_variation_id', $product_variation_id);
}
}

View File

@ -38,7 +38,7 @@ class FormAutocomplete extends ControllerBase {
// Set fulltext search keywords and fields.
$query->keys($typed_string);
$query->setFulltextFields(['name', 'synonyms']);
$query->setFulltextFields(['name', 'field_synonyms']);
// Set additional conditions.
$query->addCondition('status', 1);
@ -49,7 +49,7 @@ class FormAutocomplete extends ControllerBase {
$query->setLanguages([$lang]);
// Do paging.
$query->range(0, 10);
$query->range(0, 15);
// Add sorting.
$query->sort('search_api_relevance', 'DESC');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -578,6 +578,11 @@ header[role="banner"]{
color: #fff;
background-color: $color-main-text;
}
body.path-user & {
color: #fff;
background-color: $color-base;
text-transform: lowercase;
}
}
@include col-mediaquery-max(3){
body.path-frontpage &, body.path-home & {
@ -728,6 +733,25 @@ header[role="banner"]{
}
ul.ui-menu.ui-widget-content.ui-autocomplete {
background-color: rgba(0, 0, 0, 0.6);
border-radius: 5px;
border: none;
padding: 0.3em 0.2em;
a.ui-menu-item-wrapper{
color: #fff;
padding:0.1em 0.1em;
display: block;
&.ui-state-active{
background: none;
border: none;
color:#fff;
background-color: rgba(0, 0, 0, 0.9);
}
}
}
// main
aside.messages{
@ -735,13 +759,24 @@ aside.messages{
}
// content top
// #content-top{
// &:after{
// content:"";
// clear:both;
// display: block;
// }
// }
#content-top{
#block-tabs{
nav.tabs{
ul.tabs.primary{
li{
background-color: change-color($color-base, $alpha: 0.5);
color:#fff;
&.is-active{
background-color: $color-base;
}
a{
background-color: transparent;
}
}
}
}
}
}
#main-content.loading{
transition: all 0.3s ease-in-out;

View File

@ -203,6 +203,21 @@ function materiotheme_preprocess_page(&$vars){
// }
/**
* Implements THEME_preprocess_page_title()
*/
function materiotheme_preprocess_page_title(&$variables) {
$current_url = \Drupal\Core\Url::fromRoute('<current>');
$url = $current_url->getInternalPath();
if(preg_match('/^user\/\d+\/*/', $url)) {
$userCurrent = \Drupal::currentUser();
$user = \Drupal\user\Entity\User::load($userCurrent->id());
$email = $user->getEmail();
$variables['title'] = $email;
}
}
/**
* Implements hook_form_alter
*/