joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.75k stars 3.64k forks source link

[4] A string or Joomla\Uri\UriInterface object must be provided, a "NULL" was provided. #32917

Closed PhilETaylor closed 3 years ago

PhilETaylor commented 3 years ago

Steps to reproduce the issue

Joomla 4.0-dev (Enable Debug mode in Joomla Global Config)

Install an old version (only just old!) of Akeeba Backup Core (FREE) from https://www.akeeba.com/download/akeeba-backup/8-0-2/pkg_akeeba-8-0-2-core-zip.zip

Once installed go to:

System -> Update -> Extensions Click Clear Cache Click Find Updates See three available updates Select ALL THREE UPDATES and click UPDATE..... wait.....

Screenshot 2021-03-28 at 23 02 56

Expected result

All three available updates applied.

Actual result

Screenshot 2021-03-28 at 23 06 40

System information (as much as possible)

Additional comments

// @nikosdion

joomdonation commented 3 years ago

This should be reported to Akeeba, please. Somehow, during install/update process of the extension package, they remove updates (found by clicking on Find Updates button) of the other two items (I can only guess that it is because during update the package, they perform updates for the other two items automatically)

So when Joomla tries to update the other two items, it could not found data for these items from database (in #__updates table) anymore and it causes that reported error.

Further more, look like we also could not uninstall the package on Joomla 4, and this should be reported to them, too.

PhilETaylor commented 3 years ago

However Joomla should handle that and not display a PHP error, but a user friendly error.

I have also reported to @nikosdion

joomdonation commented 3 years ago

I can only explain the reason of the error. It's hard for us to write code to check everything (especially for a special/strange case like this one).

PhilETaylor commented 3 years ago

It's hard for us to write code to check everything

Its not hard to use try/catch blocks :) - all PHP exceptions in an app should be caught and a User Friendly (not developer friendly, unless debug mode is on) error should be shown.

nikosdion commented 3 years ago

I am not taking any bug reports for Joomla 4 for two reasons.

  1. Joomla 4 is not stable yet.
  2. I am rewriting the entire Akeeba Backup and Admin Tools components to use core MVC, BS5 styling and vanilla JS with no pre-/post- installation scripts so it's absolutely clear that any issues in the installation and update process are 100% caused by Joomla itself.

About this issue. We (Akeeba Ltd) do NOT, EVER remove updates when you install our software, Joomla does. I'm sorry that core maintainers don't know how the software they supposedly maintain works.

I am not doing anything "special" or "strange". Akeeba Backup is a package type extension. It contains a bunch of other extensions: a component, some plugins and two files packages (file_fof40 and file_fef).

The latter two packages also have update sites of their own because they can also be installed standalone. They are frameworks. As to why they are not library packages, please do read the big comment at the top of their manifests because that's yet another Joomla bug I am working around there.

None of that is "special" or "strange". It is all according to your own documentation here https://docs.joomla.org/Manifest_files

Now, Joomla finds three updates in this case: for the package type extension and one for each of the two file extensions. This is core Joomla code, namely the extensions updater which is part of com_installer. This is code that is 100% under Joomla's absolute and total control. We (Akeeba Ltd) do not write, maintain or modify this code in any way.

When Joomla itself installs the package type extension is installs each and every of the included extensions. When it installs an extension — even one included in a package type extension — it will remove the updates recorded in the #__updates table.

At this point Joomla itself becomes unaware that Joomla itself has removed the update records for the two files extensions. Joomla itself is now trying to install the two updates which no longer exists and Joomla's own code is throwing an exception.

How the heck is that a problem originating with Akeeba Ltd?!!! We DO NOT maintain Joomla's core code. Joomla does. We use the XML manifests that Joomla itself is using to find and install updates exactly how they are documented.

For crying out loud, you are given a debug backtrace which PROVES BEYOND ANY REASONABLE DOUBT that the bug comes from Joomla itself, not any code in Akeeba Ltd's extensions! Are you maliciously denigrating me and my company or are you too incompetent to debug your own project's code?

I am perfectly aware that Joomla's extensions updater is buggy, broken and unfit for purpose. However, the Joomla project is FORCING me and all other 3PDs to use its buggy, broken and unfit for purpose extensions updater on pain of our extensions being delisted from the Joomla Extensions Directory. As I said before, either fix your broken code or let us 3PDs offer our own extensions updater.

As I've proven in the past I am far more competent than the entire Joomla project in that regard. I am not grandstanding here. Akeeba Backup (under its older name, JoomlaPack) was the first Joomla extension to provide integrated updates with the Akeeba Live Update code between 2009 and 2014. I had exactly two problems in 5 years, both resolved within hours. Between 2014 and 2021 I am wasting 20% of my time providing support to my users for Joomla's extension updater bugs. Every time I make a release I know I will waste the next 2-3 days telling people why the updates fail even though it has nothing to do with our own code. I've even documented all of this, e.g. https://www.akeeba.com/documentation/akeeba-backup-documentation/update.html

I have spent dozens of hours debugging Joomla's broken code and writing pages and pages of documentation because Joomla just won't fix its broken code for eight years. Do you understand just how many hundreds of thousands of Euros of my time and lost sales this has cost me over these past eight years? Do you understand that every time I proposed to fix your broken crap I was stonewalled and had to suffer the consequences of an issue that is most definitely not of our own making?

Being accused that somehow it's my fault that Joomla's own code is buggy is beyond annoying. It's defamatory, if not outright libellous. This is the umpteenth time that the Joomla project is accusing me personally or my company for bugs in Joomla's own code that are in its own absolute and total control. CEASE AND DESIST IMMEDIATELY OR I WILL BE FORCED TO TAKE LEGAL ACTION. Enough is enough!

PhilETaylor commented 3 years ago

If I could find another three Joomla 4 compatible extensions, with updates available, I would have tested them too to prove this was not an Akeeba based issue :)

I'll circle back to this bug at the end of the week, having spent the last 4 full days on open source I need to do my day job today :-(

alikon commented 3 years ago

I am not taking any bug reports for Joomla 4 for two reasons.

  1. Joomla 4 is not stable yet.
  2. I am rewriting the entire Akeeba Backup and Admin Tools components to use core MVC, BS5 styling and vanilla JS with no pre-/post- installation

better to repoen this on RC i guess then ?

alikon commented 3 years ago

still planning one of these days to read your "short" answer :smiley:

PhilETaylor commented 3 years ago

your "short" answer

The short answer this is not an Akeeba bug. It's a Joomla bug.

PhilETaylor commented 3 years ago

When Joomla itself installs the package type extension is installs each and every of the included extensions. When it installs an extension — even one included in a package type extension — it will remove the updates recorded in the #__updates table.

At this point Joomla itself becomes unaware that Joomla itself has removed the update records for the two files extensions. Joomla itself is now trying to install the two updates which no longer exists and Joomla's own code is throwing an exception.

So the fix is to stop Joomla removing updates from the cached updates list, and then once EVERYTHING in a package is installed, then flush the update cache table of all pending updates. Simples.

alikon commented 3 years ago

then simply submit a PR..... i really cannot understand why not ? ...if it is so simple ... yes PR's "sometimes" are rejected.... etc...

PhilETaylor commented 3 years ago

Im sorry @alikon who rattled your cage tonight?

then simply submit a PR.....

I will... instead of cooking my daughter food I will do as you demand.. geese...

...if it is so simple ...

Im sorry that I did not have time to dig deep into this one while fixing the other issues on the same day... Im sorry there were not enough hours in the 4 days I contributed to open source last week to investigate and fix this one bug, so I had to log it so that others - you know the community - could contribute...

alikon commented 3 years ago

hey man I'm not your boss, i've just expressed my thinking about this, like it or not

PhilETaylor commented 3 years ago

PR https://github.com/joomla/joomla-cms/pull/32936 I look forward to you testing - thanks.

alikon commented 3 years ago

sure....i'll do it maybe not tomorrow... but i'll do it