No Code Attached Yet
avatar richard67
richard67
10 Mar 2024

Steps to reproduce the issue

On a current 5.1-dev branch or a 5.1.0.-beta1, change the update channel in the Joomla Update component's options to "Custom URL" and enter the custom update URL created by drone for some current 5.1-dev PR. E.g. for PR #42992 use https://artifacts.joomla.org/drone/joomla/joomla-cms/5.1-dev/42992/downloads/74472/pr_list.xml .

Result: An update to the patched package for that PR is found.

Try to update.

Expected result

Live update with a custom update URL for a pull request works.

Actual result

2024-03-10_j5 1 0-beta1_live-update-to-pr-package

System information (as much as possible)

Joomla 5.1.0-beta1 or current 5.1-dev branch or nightly build which include the TUF implementation from PR #42799 .

Additional comments

Upload & Update with pull request packages works as before the TUF PR, only Live Update has that problem.

No idea why I haven't noticed that when testing PR #42799 .

The error message comes from a new version check implemented with PR #42799 here:

https://github.com/joomla/joomla-cms/blob/5.1-dev/administrator/components/com_joomlaupdate/src/Controller/UpdateController.php#L65-L77

        // The versions mismatch
        if ($result['version'] !== $this->input->get('targetVersion')) {
            $message     = Text::_('COM_JOOMLAUPDATE_VIEW_UPDATE_VERSION_WRONG');
            $messageType = 'error';
            $url         = 'index.php?option=com_joomlaupdate';

            $this->app->setUserState('com_joomlaupdate.file', null);
            $this->setRedirect($url, $message, $messageType);

            Log::add($message, Log::ERROR, 'Update');

            return;
        }

Some debug output which I've added shows that $result['version'] is 5.1.0-beta2-dev+pr.42992 and $this->input->get('targetVersion') is 5.1.0-beta2-devpr.42992, so the latter is missing the + between the devand the pr.

avatar richard67 richard67 - open - 10 Mar 2024
avatar joomla-cms-bot joomla-cms-bot - change - 10 Mar 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 10 Mar 2024
avatar richard67 richard67 - change - 10 Mar 2024
The description was changed
avatar richard67 richard67 - edited - 10 Mar 2024
avatar richard67 richard67 - change - 10 Mar 2024
The description was changed
avatar richard67 richard67 - edited - 10 Mar 2024
avatar richard67 richard67 - change - 10 Mar 2024
The description was changed
avatar richard67 richard67 - edited - 10 Mar 2024
avatar richard67
richard67 - comment - 10 Mar 2024

I think I know how to fix it. It just needs the "sting" filter for the input->get.

avatar richard67 richard67 - change - 10 Mar 2024
The description was changed
avatar richard67 richard67 - edited - 10 Mar 2024
avatar richard67 richard67 - change - 10 Mar 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-03-10 11:19:21
Closed_By richard67
avatar richard67 richard67 - close - 10 Mar 2024
avatar richard67
richard67 - comment - 10 Mar 2024

Closing as having a pull request. See #42994 . I did not expect to find the cause of the issue so fast.

Add a Comment

Login with GitHub to post a comment