J4 Issue ?
avatar brianteeman
brianteeman
10 May 2019

The new code to display the changelog of an available update in the extension manager produces a javascript error when you click on the button

/cc @roland-d

core.min.js?384e8209bc67fc38429624bf76893747:1 Uncaught TypeError: Cannot set property 'innerHTML' of undefined
    at onSuccess (core.min.js?384e8209bc67fc38429624bf76893747:1)
    at XMLHttpRequest.c.onreadystatechange (core.min.js?384e8209bc67fc38429624bf76893747:1)
onSuccess @ core.min.js?384e8209bc67fc38429624bf76893747:1
c.onreadystatechange @ core.min.js?384e8209bc67fc38429624bf76893747:1
XMLHttpRequest.send (async)
a.request @ core.min.js?384e8209bc67fc38429624bf76893747:1
a.loadChangelog @ core.min.js?384e8209bc67fc38429624bf76893747:1
onclick @ index.php?option=com_installer&view=update:546
avatar brianteeman brianteeman - open - 10 May 2019
avatar joomla-cms-bot joomla-cms-bot - change - 10 May 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 10 May 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 10 May 2019
Labels Added: J4 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 10 May 2019
avatar C-Lodder
C-Lodder - comment - 10 May 2019

@brianteeman https://github.com/joomla/joomla-cms/blob/4.0-dev/build/media_source/system/js/core.es6.js#L938

Try replacing:

document.querySelectorAll(`#changelogModal${extensionId} .modal-body`)[0].innerHTML = result.data;

with this:

document.querySelector(`#changelogModal .modal-body`).innerHTML = result.data;

Although this Javascript really needs to be moved out of core.js and into a separate file associated with com_installer: https://github.com/joomla/joomla-cms/blob/4.0-dev/build/media_source/com_installer/js/installer.es6.js

Perhaps someone can move the inline JS too: https://github.com/joomla/joomla-cms/pull/24026/files#diff-8bbf22d9af9d1d1e6f15a80c694446e2R109

avatar franz-wohlkoenig franz-wohlkoenig - change - 11 May 2019
Status New Discussion
avatar brianteeman
brianteeman - comment - 12 May 2019

Thanks @C-Lodder I will leave it for someone else to make the pr

avatar roland-d
roland-d - comment - 13 May 2019

Closing as we have a PR #24890

avatar roland-d roland-d - change - 13 May 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-05-13 18:13:14
Closed_By roland-d
avatar roland-d roland-d - close - 13 May 2019

Add a Comment

Login with GitHub to post a comment