Skip to content

Social links stopped working due to dependency changes #134

@pzlakowski

Description

@pzlakowski

Describe the bug

The AddToAny dependency changed their code module and when

To Reproduce

Minimal reproduction:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script defer src="https://static.addtoany.com/menu/page.js"></script>
</head>Ļ
<body>
  <div id="a2a" class="a2a_kit a2a_kit_size_32 a2a_default_style">
    <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
    <a class="a2a_button_facebook"></a>
    <a class="a2a_button_mastodon"></a>
    <a class="a2a_button_email"></a>
  </div>
</body>
</html>

Reproduction in the project:

Visit the page with enabled social links, you will see:

Uncaught TypeError: D is not a function
    at Xe (core.ydpp7jcu.js:1:46960)
    at fa (core.ydpp7jcu.js:1:64780)
    at te (core.ydpp7jcu.js:1:10518)
    at core.ydpp7jcu.js:1:9898
    at o (core.ydpp7jcu.js:1:25353)
    at l (core.ydpp7jcu.js:1:25393)
    at r (core.ydpp7jcu.js:1:9825)
    at ma (core.ydpp7jcu.js:1:71064)
    at g (page.js:1:3154)
    at page.js:1:3188

When you rename id a2a to dspace-a2a both in html and css file and then feature starts working correctly once again. It could be that a2a started to be a reserved word for the library...

Expected behavior

AddToAny initializes properly.

Related Work

I did this in PR for main DSpace. I could issue a PR for CRIS on Monday.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions