upgraded core, fixed customs modules

This commit is contained in:
2022-02-15 11:22:01 +01:00
parent 7bc35bdc1f
commit 1f07e66fe6
82 changed files with 38856 additions and 1772 deletions

View File

@@ -1,5 +1,5 @@
name: 'materio_user'
type: module
description: ''
core: 8.x
core_version_requirement: ^8.8 || ^9.2
package: 'Materio'

View File

@@ -9,7 +9,7 @@ use \Drupal\Core\Form\FormStateInterface;
use \Drupal\Core\Block\BlockPluginInterface;
use \Drupal\Core\Url;
use \Drupal\Core\Link;
use \Drupal\materio_user\MaterioUserLoginBlockAlterRender;
/**
* implements hook_form_FORM_ID_alter()
*
@@ -121,10 +121,12 @@ function _materio_user_process_password_confirm($element){
/**
* implements hook_block_view_BASE_BLOCK_ID_alter()
*
* https://www.drupal.org/project/drupal/issues/2626224
* OLD D8 https://www.drupal.org/project/drupal/issues/2626224
* NEW D9 https://www.drupal.org/node/2966725
*/
function materio_user_block_view_user_login_block_alter(array &$build, BlockPluginInterface $block) {
$build['#pre_render'][] = '_materio_user_user_login_block_pre_render';
// $build['#pre_render'][] = '_materio_user_user_login_block_pre_render';
$build['#pre_render'][] = [MaterioUserLoginBlockAlterRender::class, 'preRender'];
}
function _materio_user_user_login_block_pre_render(array $build){

View File

@@ -21,7 +21,7 @@ class AjaxLoginBlock extends ControllerBase {
// \Drupal::logger('materio_user')->notice($language);
$this->bid = "userlogin";
$this->block = Block::load($this->bid);
$this->block_builded = \Drupal::entityManager()->getViewBuilder('block')->view($this->block);
$this->block_builded = \Drupal::entityTypeManager()->getViewBuilder('block')->view($this->block);
}
/**

View File

@@ -0,0 +1,44 @@
<?php
namespace Drupal\materio_user;
use Drupal\Core\Security\TrustedCallbackInterface;
/**
* Provides a trusted callback to alter the commerce cart block.
*
* @see olla_common_block_view_commerce_cart_alter()
*/
class MaterioUserLoginBlockAlterRender implements TrustedCallbackInterface {
/**
* {@inheritdoc}
*/
public static function trustedCallbacks() {
return ['preRender'];
}
/**
* Sets - #pre_render callback.
*/
public static function preRender($build) {
$user_links = &$build['content']['user_links'];
$items = &$user_links['#items'];
unset($items['create_account']);
// $items['create_account']['#url']->mergeOptions(array(
// "attributes" => array(
// "@click.prevent" => "create_account"
// )
// ));
// Do not handle passward reset with vue
// $items['request_password']['#url']->mergeOptions(array(
// 'attributes' => array(
// "@click.prevent" => "request_password"
// )
// ));
return $build;
}
}