πŸ‡ΊπŸ‡ΈUnited States @theprodigy

Account created on 25 January 2010, about 15 years ago
#

Recent comments

πŸ‡ΊπŸ‡ΈUnited States theprodigy

I thought I would give more context around how this was replicated. I found that I can save a bookmark by writing out the save object. The problem seems to come from trying to create a link. The following is the code I'm using to create that link:

function [hook]_preprocess_group(&$variables){

$group = $variables['group'];

// add a flag link for bookmarks
$flag_link = [
'#lazy_builder' => ['flag.link_builder:build', [
'group', //also tried with $group->getEntityTypeId(),
$group->id(),
'bookmark',
]],
'#create_placeholder' => TRUE,
];
$variables['flag_link'] = $flag_link;

This creates the link from the template by using {{ flag_link }}. After clicking on that link however I get the error described on this issue. I found that if I create my own save it seems to save the flag just fine with the following code:

$flag = \Drupal\flag\Entity\Flag::create([
'id' => $group->id(),
'entity_type' => 'group',
'bundles' => [
'customer',
],
'flag_type' => 'entity:group',
'link_type' => 'reload',
'flagTypeConfig' => [],
'linkTypeConfig' => [],
]);
$flag->save();

So it would seem if I want to bypass this issue I'll have to create my own links to save and remove. I hope this helps debug the issue for others.

πŸ‡ΊπŸ‡ΈUnited States theprodigy

I am not sure how you tested this but I am seeing the exact same issue. I am trying to create a bookmark by code for groups. From what I see I should be able to just use a hook preprocess group then add the flag to the twig template.

After writing the code I ended up with the same results as the title of this issue:

Type page not found
Date Tuesday, March 11, 2025 - 13:54
Location https://localhost/flag/flag/bookmark/2860?_wrapper_format=drupal_ajax&de...
Referrer https://localhost/admin/reports/dblog/event/703
Message /flag/flag/bookmark/2860?_wrapper_format=drupal_ajax&destination=/customer/acquisition-service-fas&token=Yz12EQbsQsAf4Ro5JtQyYDUAAbO2mpC1en24tGZjt5A

πŸ‡ΊπŸ‡ΈUnited States theprodigy

I am not sure what actually works to create an or condition in Drupal 10.  Nothing I've tried nor what's on this page works.

πŸ‡ΊπŸ‡ΈUnited States theprodigy

I was able to get this to work finally. It requires the alpha version of open id. Then after configuring the other end to accept jwt it worked fine.

Production build 0.71.5 2024