Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert banner with empty Link text should show "More information", but nothing shows #245

Open
keelanfh opened this issue May 11, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@keelanfh
Copy link
Member

On a clean install with localgov_base, there's this wording when creating an Alert banner ("If you don't write anything here, we will use: More information").

image

But looking at the banner on the site, I see no link at all:

image

@andybroomfield andybroomfield added the bug Something isn't working label May 11, 2023
@andybroomfield
Copy link
Contributor

With the default theme set to oliveo, the More information link is displayed.
Maybe this is an issue with Localgov base?

Screenshot 2023-05-12 at 10 37 48 am

@andybroomfield
Copy link
Contributor

And a test on BHCC theme
Screenshot 2023-05-12 at 10 39 46 am

@andybroomfield
Copy link
Contributor

This is set by localgov_alert_banner.page.inc

// Set default link text if field exists.
  if ($entity->hasField('link')) {
    if ($entity->get('link')->title === '') {
      $variables['content']['link'] = Link::fromTextAndUrl(t('More information'), Url::fromUri($entity->get('link')->uri))->toString();
    }
  }

Is localgov_base overriding this @markconroy ?

@ctorgalson
Copy link

@andybroomfield sort of. It's that the existing assignment to $variables['content']['link'] quoted above changes the render array to from a LinkItem to a GeneratedLink, I believe.

@petrillek just noticed this too. I'll create a PR in a few minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants