🇨🇿Czech Republic @kryber

Account created on 8 July 2010, almost 14 years ago
#

Recent comments

🇨🇿Czech Republic kryber

Hello!

Thank you very much! At my work they are forcing me to use Windows environment and IIS. And here, I almost took my own thumb in order to make it work and I didn't want to use the libraries for it. And because of this, it is now working.

So tested and and it works! Thank you! Hopefully it will get into the core asap.

🇨🇿Czech Republic kryber

It still needs the "gin--edit-form" to be added in a body class.

🇨🇿Czech Republic kryber

And in module i did this:

<?php

use Drupal\Core\Form\FormStateInterface;
use Drupal\regcode\RegcodeElementValidationTrait;

/**
 * Implements hook_form_alter().
 */
function wizionary_gin_login_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  // Zkontrolujte, zda se jedná o váš cílový formulář.
  if ($form_id === 'user_registration_type_artist_form') {
    // Získejte konfiguraci modulu Regcode.
    $config = \Drupal::config('regcode.settings');

    // Přidejte pole regcode do formuláře.
    $form['regcode'] = [
      '#type' => 'textfield',
      '#title' => $config->get('regcode_field_title'),
      '#description' => $config->get('regcode_field_description'),
      '#required' => !($config->get('regcode_optional') || \Drupal::currentUser()->hasPermission('administer users')),
      '#element_validate' => ['regcode_code_element_validate'],
    ];

    // Přidejte submit handler pro zpracování pole regcode.
    $form['actions']['submit']['#submit'][] = 'regcode_user_register_form_submit_handler';

    // Získejte regcode z URL, pokud je přítomen, a vložte ho do registračního formuláře.
    if (\Drupal::request()->query->has('regcode')) {
      $form['regcode']['#value'] = \Drupal::request()->query->get('regcode');
      $form['regcode']['#description'] = NULL;
      $form['regcode']['#disabled'] = TRUE;
    }
  }
}

/**
 * Implements hook_page_attachments() or hook_entity_view() or any other appropriate hook.
 */
function wizionary_gin_login_page_attachments(array &$attachments) {
  // Připojení knihoven z modulu 'gin_login'.
  $attachments['#attached']['library'][] = 'gin_login/login';
}

/**
 * Implements preprocess_html() - adds gin-login to everything after /user/register/
 */
function wizionary_gin_login_preprocess_html(&$variables) {
  $current_path = \Drupal::service('path.current')->getPath();
  if (strpos($current_path, '/user/register/') === 0) {
    $variables['attributes']['class'][] = 'gin-login';
  }
}
🇨🇿Czech Republic kryber

I write my module that uses theme.negotiator in .services.yml file and in src/Theme/ThemeNegotiator.php this.

<?php 

namespace Drupal\wizionary_gin_login\Theme;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Drupal\Core\Routing\RouteMatchInterface;

class ThemeNegotiator implements EventSubscriberInterface {

  public static function getSubscribedEvents() {
    return [KernelEvents::REQUEST => ['onRequest']];
  }

  public function onRequest(GetResponseEvent $event) {
    // \Drupal::logger('wizionary_gin_login')->notice('TestService onRequest called.');
  }
  
  public function applies(RouteMatchInterface $route_match) {
    // \Drupal::logger('wizionary_gin_login')->notice('ThemeNegotiator applies method called.');
    return $this->negotiateRoute($route_match) ? TRUE : FALSE;
  }

  public function determineActiveTheme(RouteMatchInterface $route_match) {
    // \Drupal::logger('wizionary_gin_login')->notice('ThemeNegotiator determineActiveTheme method called.');
    return $this->negotiateRoute($route_match) ?: NULL;
  }

  private function negotiateRoute(RouteMatchInterface $route_match) {
    // \Drupal::logger('wizionary_gin_login')->notice('ThemeNegotiator negotiateRoute method called.');
    $current_path = \Drupal::service('path.current')->getPath();
    $current_path_alias = \Drupal::service('path_alias.manager')->getAliasByPath($current_path);
    if ($current_path_alias == '/user/register/artist') {
      return 'gin';
    }
    return FALSE;
  }
  
}
🇨🇿Czech Republic kryber

Thank you timotej-pl! It worked

🇨🇿Czech Republic kryber

Thw new is perfect!! Thank you!

🇨🇿Czech Republic kryber

Hello, is this still included?

🇨🇿Czech Republic kryber

Hello,

I am sorry if I confused you with my text; this sometimes happens to me :) I meant that it might also symbolize "information."


https://pasteboard.co/0hX9pqRQ60OO.png

I might be wrong if no more people see it.

Anyway, best regards and beautiful day!

🇨🇿Czech Republic kryber

Thank you! I write them all. So we will see. Have a nice day!

🇨🇿Czech Republic kryber

The proposed solution for #2 is the one we are looking for. Please, is there anyone willing to update it? We are willing to sponsor it. Thank you!

🇨🇿Czech Republic kryber

Yes, absolutely! They are nice and smooth :)

The other part was to connect the right libraries for the server. On my local mac machine I needed to use the linux64. https://ffbinaries.com/downloads

🇨🇿Czech Republic kryber

I corrected it by adding a #[\ReturnTypeWillChange] before all the functions in a file vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/Configuration.php.

<?php

/*
 * This file is part of Alchemy\BinaryDriver.
 *
 * (c) Alchemy <info@alchemy.fr>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Alchemy\BinaryDriver;

class Configuration implements ConfigurationInterface
{

    private $data;
    #[\ReturnTypeWillChange]
    public function __construct(array $data = array())
    {
        $this->data = $data;
    }

    /**
     * {@inheritdoc}
     */
    #[\ReturnTypeWillChange]
    public function getIterator()
    {
        return new \ArrayIterator($this->data);
    }

    /**
     * {@inheritdoc}
     */
    #[\ReturnTypeWillChange]
    public function get($key, $default = null)
    {
        return isset($this->data[$key]) ? $this->data[$key] : $default;
    }

    /**
     * {@inheritdoc}
     */
    #[\ReturnTypeWillChange]
    public function set($key, $value)
    {
        $this->data[$key] = $value;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    #[\ReturnTypeWillChange]
    public function has($key)
    {
        return array_key_exists($key, $this->data);
    }

    /**
     * {@inheritdoc}
     */
    #[\ReturnTypeWillChange]
    public function remove($key)
    {
        $value = $this->get($key);
        unset($this->data[$key]);

        return $value;
    }

    /**
     * {@inheritdoc}
     */
    #[\ReturnTypeWillChange]
    public function all()
    {
        return $this->data;
    }

    /**
     * {@inheritdoc}
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return $this->has($offset);
    }

    /**
     * {@inheritdoc}
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return $this->get($offset);
    }

    /**
     * {@inheritdoc}
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        $this->set($offset, $value);
    }

    /**
     * {@inheritdoc}
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        $this->remove($offset);
    }
}
🇨🇿Czech Republic kryber

Hello, I am having the same problem. Trying to use media-thumbnails and having the right binary files in place, the only appearing problem is this.


Deprecated function: Return type of Alchemy\BinaryDriver\Configuration::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice ve funkci include() (řádek 14 souboru /app/docroot/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/Configuration.php)
#0 /app/docroot/core/includes/bootstrap.inc(347): _drupal_error_handler_real(8192, 'Return type of ...', '/app/docroot/ve...', 103)
#1 /app/docroot/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/Configuration.php(14): _drupal_error_handler(8192, 'Return type of ...', '/app/docroot/ve...', 103)
#2 /app/docroot/vendor/composer/ClassLoader.php(578): include('/app/docroot/ve...')
#3 /app/docroot/vendor/composer/ClassLoader.php(432): Composer\Autoload\ClassLoader::Composer\Autoload\{closure}('/app/docroot/ve...')
#4 /app/docroot/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php(42): Composer\Autoload\ClassLoader->loadClass('Alchemy\\BinaryD...')
#5 /app/docroot/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(226): FFMpeg\Driver\FFProbeDriver::create(Array, NULL)
#6 /app/docroot/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php(132): FFMpeg\FFProbe::create(Array, NULL, Object(Symfony\Component\Cache\Adapter\ArrayAdapter))
#7 /app/docroot/modules/contrib/media_thumbnails_video/src/Plugin/MediaThumbnail/MediaThumbnailVideo.php(39): FFMpeg\FFMpeg::create(Array)
#8 /app/docroot/modules/contrib/media_thumbnails/src/Plugin/MediaThumbnailManager.php(103): Drupal\media_thumbnails_video\Plugin\MediaThumbnail\MediaThumbnailVideo->createThumbnail('public://2023-0...')
#9 /app/docroot/modules/contrib/media_thumbnails/src/Plugin/MediaThumbnailManager.php(119): Drupal\media_thumbnails\Plugin\MediaThumbnailManager->createThumbnail(Object(Drupal\media\Entity\Media))
#10 /app/docroot/modules/contrib/media_thumbnails/media_thumbnails.module(36): Drupal\media_thumbnails\Plugin\MediaThumbnailManager->updateThumbnail(Object(Drupal\media\Entity\Media))
#11 [internal function]: media_thumbnails_media_presave(Object(Drupal\media\Entity\Media))
#12 /app/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array(Object(Closure), Array)
#13 /app/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'media_thumbnail...')
#14 /app/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith('media_presave', Object(Closure))
#15 /app/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(249): Drupal\Core\Extension\ModuleHandler->invokeAll('media_presave', Array)
#16 /app/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(903): Drupal\Core\Entity\EntityStorageBase->invokeHook('presave', Object(Drupal\media\Entity\Media))
#17 /app/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(563): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('presave', Object(Drupal\media\Entity\Media))
#18 /app/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(756): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\media\Entity\Media))
#19 /app/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(517): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave(Object(Drupal\media\Entity\Media))
#20 /app/docroot/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(804): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\media\Entity\Media))
#21 /app/docroot/core/modules/media/src/MediaStorage.php(29): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object(Drupal\media\Entity\Media))
#22 /app/docroot/core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\media\MediaStorage->save(Object(Drupal\media\Entity\Media))
#23 /app/docroot/modules/contrib/media_thumbnails/src/Batch/RefreshBatch.php(72): Drupal\Core\Entity\EntityBase->save()
#24 /app/docroot/core/includes/batch.inc(295): Drupal\media_thumbnails\Batch\RefreshBatch::process(Array, Array)
#25 /app/docroot/core/includes/batch.inc(137): _batch_process()
#26 /app/docroot/core/includes/batch.inc(93): _batch_do()
#27 /app/docroot/core/modules/system/src/Controller/BatchController.php(55): _batch_page(Object(Symfony\Component\HttpFoundation\Request))
#28 [internal function]: Drupal\system\Controller\BatchController->batchPage(Object(Symfony\Component\HttpFoundation\Request))
#29 /app/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#30 /app/docroot/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#31 /app/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#32 /app/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#33 /app/docroot/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#34 /app/docroot/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#35 /app/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 /app/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#37 /app/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#38 /app/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#39 /app/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#40 /app/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#41 /app/docroot/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#42 /app/docroot/core/lib/Drupal/Core/DrupalKernel.php(713): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#43 /app/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#44 {main}
.

Production build 0.69.0 2024