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

EBI Groups header looks broken - clearing API caching make it work #606

Open
sandykadam opened this issue Nov 23, 2020 · 7 comments
Open
Labels
bug Something isn't working

Comments

@sandykadam
Copy link
Collaborator

sandykadam commented Nov 23, 2020

I have noticed on some EBI groups that header links looks broken, when we clear the API cache from admin and then refresh the page fixes it. My understanding was API cache is set for certain interval and it will autofetch the new records past that interval but it doesn't seem to work in that way.

https://wwwdev.ebi.ac.uk/about/teams/web-production/

Screenshot 2020-11-23 at 12 51 55

I saw similar issue on Webdev team but when I clear API cache it worked.

More examples.
https://wwwdev.ebi.ac.uk/about/teams/software-development-operations/members/
https://wwwdev.ebi.ac.uk/about/teams/technology-science-integration/members/

@sandykadam sandykadam added the bug Something isn't working label Nov 23, 2020
@dbushell
Copy link
Collaborator

Seems to be caused by the vf-content class on the <header id="masthead-black-bar"... element (HTML is from the Content Hub) — at least, removing that class seems to fix it. That said, the visual framework example is using the class.

Tested on my local version it has no issue. Maybe VF CSS is out of date on those sites?

@khawkins98 @sturobson do you know what's going on here?

@khawkins98
Copy link
Contributor

In the contentHub response (view-source:https://content.embl.org/api/v1/pattern.html?filter-content-type=article&filter-id=6682&pattern=node-body) there is a stylesheet link included:

<link rel="stylesheet" href="https://assets.emblstatic.net/vf/v2.2.0/assets/ebi-header-footer/ebi-header-footer.css" type="text/css" media="all" />
<header id="masthead-black-bar" class="clearfix masthead-black-bar | ebi-header-footer vf-content vf-u-fullbleed"</header>

This stylesheet part of the HTML response doesn't seem to get stored in the cache. Is that expected?

@dbushell
Copy link
Collaborator

This is what is caching on my local docker:

<div class="vf-content-hub-html">
    <!-- Generated by: http://content.embl.org/api/v1/pattern.html?filter-content-type=article&amp;filter-id=6682&amp;pattern=node-body&amp;source=contenthub -->
            <div data-embl-js-conditional-edit="6682">
            <link rel="stylesheet" href="https://assets.emblstatic.net/vf/v2.2.0/assets/ebi-header-footer/ebi-header-footer.css" type="text/css" media="all" />
<header id="masthead-black-bar" class="clearfix masthead-black-bar | ebi-header-footer vf-content vf-u-fullbleed"></header>

            <a class="vf-text vf-text--body-r vf-link embl-conditional-edit" rel="noopener noreferrer nofollow" href="https://content.embl.org/node/6682" target="_blank">Edit</a>
        </div>
    </div>

@khawkins98
Copy link
Contributor

khawkins98 commented Nov 23, 2020

Strange. @sandykadam any reason why the <link element wouldn't get cached on the EBI servers?

https://wwwdev.ebi.ac.uk/about/teams/software-development-operations/members/

<div class="vf-content-hub-html" data-cache="2c418982">
    <!-- Generated by: http://content.embl.org/api/v1/pattern.html?filter-content-type=article&amp;filter-id=6682&amp;pattern=node-body -->
            <div data-embl-js-conditional-edit="6682">
            
<header id="masthead-black-bar" class="clearfix masthead-black-bar | ebi-header-footer vf-content vf-u-fullbleed"></header>

            <a class="vf-text vf-text--body-r vf-link embl-conditional-edit" rel="noopener noreferrer nofollow" href="https://content.embl.org/node/6682" target="_blank">Edit</a>
        </div>
    </div>

@sandykadam
Copy link
Collaborator Author

I don't think it has to do anything with servers, as I can see same entry in SDO website. It just for somehow doesn't renders correctly in frontend.

Screenshot 2020-11-23 at 14 01 54

@khawkins98
Copy link
Contributor

Is there a strip_tags somewhere when the cache gets rendered?

@dbushell
Copy link
Collaborator

No that I'm aware of. The cache plugin just stores the raw response and the template isn't stripping anything.

It'd take a bit of code to strip the <link ... /> but keep everything else intact.

khawkins98 added a commit that referenced this issue Dec 15, 2020
This addresses three things:

1. Loads a VF 2.0 format footer for EBI
2. Becuase of that we can drop VF 1.x CSS, and no longer need to add the `ebi-vf1-integration` class
3. Always loads the ebi-header-footer.css for EBI sites (workaround for #606)
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