How to correctly manipulate menu items dynamically on each page request in Drupal 8?

I need to change menuitems dynamically on a custom menu created in Drupal.
I need to show, hide, alter title etc, depending on each user and some other different conditions.

I have tried to use:
HOOK_menu_links_discovered_alter(&$links)
HOOK_preprocess_menu(&$variables, $hook)

And they both let me manipulate the meny. But only once when I empty cache. After that it ignores any further changes.
(For me it strange that preprocess_menu doesn't run on every request.)

/admin/content not working after update

I just updated from 8.6.18 to 8.9.2 and everything works fine except for the page where I add new content (or see the list of current content). I ran the update manually because I don't have access to composer - I'm on shared hosting.

You can see a screenshot of what I get when I click on content in the admin bar here; http://stagingclcs.com.au/sites/default/files/2020-08/drupal.jpg (I could figure how to add a new file to drupal.org)

Layout Builder issue after migrating D7 to D8

Hey guys,

I recently migrated my D7 site to D8. In the upgrade, I migrated all my Field_Collection module content to use Paragraphs.

Everything worked perfectly until I decided to try out Layout Builder...

When I activate Layout Builder in a content type that uses paragraphs, I get: 

The website encountered an unexpected error. Please try again later.

in dblog, it says this:

D6=>D7=>D8 or D6=>D8

I have some Drupal 6 sites which I need to move to Drupal 8 in the hope of getting them functional again.  Can I migrate them directly to Drupal 8 or do I need to do a two step migration through Drupal 7 as an intermediary?

scheduler not always publishing but it does show as successful on logs

On drupal 8
Scheduler not always publishing content pages but it does show as successful on report logs and messages.

I would like to know what could be the issue and where can I find the scheduler module code to try debugging, I could not find the under vendor or project at all.

If you need any more info let me know which and I'll provide since I don't know much about how scheduler cron works

This is the code for extending the core schedule functionality, it runs after the publish is done. 

The Render array for image in a string

HI

I want to use phpqrcode generate a qr code on my page.

My code for generate QR code is something like below:

ob_start();
QRcode::png($text,$false,$levle,$size,$margin,true);
$image = ob_get_contents();
ob_end_clean();

As You can see, I don't want to generate a QRcode file in my server.

And the browser shows a QR code on my page. Only a qr code.

My question is how can i use drupal render array to render this image?

Is it possible using image_style to render the image? How can i get the uri of the image? 

Thanks!

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x