Advertisement

I can't get the <update> mechanism to work. Topic is solved

For Joomla! 4.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
ppetree
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Wed Nov 13, 2013 7:43 pm
Location: Knoxville, TN
Contact:

I can't get the <update> mechanism to work.

Post by ppetree » Thu Jun 06, 2024 5:31 pm

I'm running Joomla 4.4.x

I developed a module called GeoTracker (source available on GitHub, and have it deployed on several sites.

I've created an update 1.9.0 (previous was 1.8.85). I can manually update 1.8.85 to 1.9.0 without a problem but what I can't do is get the auto-update feature to work.

Both versions reference the same github url for the update.xml file:
https://raw.githubusercontent.com/ppetr ... update.xml

If you manually follow that link you get the update.xml file but no update and no error messages. The update engine shows the exact same url and, again, no errors.

How do I debug this?

Advertisement
SharkyKZ
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3006
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: I can't get the <update> mechanism to work.

Post by SharkyKZ » Thu Jun 06, 2024 6:31 pm

The version in targetplatform is supposed to be a regex.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2817
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: I can't get the <update> mechanism to work.

Post by ceford » Thu Jun 06, 2024 8:58 pm

Does not work is not a lot to go on. Do you see the item in the Extensions: Update list?

Some documentation: https://jdocmanual.org/jdocmanual?manua ... -server.md

ppetree
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Wed Nov 13, 2013 7:43 pm
Location: Knoxville, TN
Contact:

Re: I can't get the <update> mechanism to work.

Post by ppetree » Thu Jun 06, 2024 9:44 pm

SharkyKZ wrote: Thu Jun 06, 2024 6:31 pm The version in targetplatform is supposed to be a regex.
That wasn't clear to me in the docs so thanks. I changed the targetplatform to:

Code: Select all

<targetplatform name="joomla" version="((3\.(8|9|10|11))|(4\.(0|1|2|3|4|5))"/>
But still no joy.
ceford wrote: Thu Jun 06, 2024 8:58 pm Does not work is not a lot to go on. Do you see the item in the Extensions: Update list?

Some documentation: https://jdocmanual.org/jdocmanual?manua ... -server.md
Sorry, I wasn't even sure what questions to ask or symptoms to describe. No the module is not in the Extensions: Update list.

Thanks for posting the doc ref. I'd already found it on the Joomla site and I thought I had everything correct but still no joy.

I did turn on custom logging and added "updater" to the tags field. That got me the following (only including mine here) which tells me that it's hitting github.

Code: Select all

#Date: 2024-06-06 20:58:20 UTC
#Software: Joomla! 4.4.0 Stable [ Pamoja ] 17-October-2023 16:00 GMT

#Fields: datetime	priority clientip	category	message
2024-06-06T20:58:33+00:00	INFO 73.108.58.66	updater	Loading information from update site #82 with name "GeoTracker Update Site" and URL https://raw.githubusercontent.com/ppetree/geotracker/main/source/update.xml took 0.11 seconds
2024-06-06T20:59:08+00:00	INFO 73.108.58.66	updater	Loading information from update site #82 with name "GeoTracker Update Site" and URL https://raw.githubusercontent.com/ppetree/geotracker/main/source/update.xml took 0.22 seconds
2024-06-06T20:59:15+00:00	INFO 73.108.58.66	updater	Loading information from update site #82 with name "GeoTracker Update Site" and URL https://raw.githubusercontent.com/ppetree/geotracker/main/source/update.xml took 0.21 seconds
2024-06-06T21:26:19+00:00	INFO 73.108.58.66	updater	Loading information from update site #82 with name "GeoTracker Update Site" and URL https://raw.githubusercontent.com/ppetree/geotracker/main/source/update.xml took 0.63 seconds
2024-06-06T21:26:32+00:00	INFO 73.108.58.66	updater	Loading information from update site #82 with name "GeoTracker Update Site" and URL https://raw.githubusercontent.com/ppetree/geotracker/main/source/update.xml took 0.24 seconds
Any other suggestions?

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2817
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: I can't get the <update> mechanism to work.

Post by ceford » Fri Jun 07, 2024 7:23 am

You have:

Code: Select all

		<targetplatform name="joomla" version="((3\.(8|9|10|11))|(4\.(0|1|2|3|4|5))"/>
I have:

Code: Select all

        <targetplatform name="joomla" version="[456].[012345]" />
For 10 and 11 you do have to have alternatives. So maybe 3.[89]|3.10|3.11|4.[012345]

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2817
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: I can't get the <update> mechanism to work.

Post by ceford » Fri Jun 07, 2024 7:37 am

In your manifest file you have:

Code: Select all

    <name>GeoTracker - Shows The Latest Visitors On A Google Map</name>[/code

I think it should be your extension element name: mod_geotracker

ppetree
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Wed Nov 13, 2013 7:43 pm
Location: Knoxville, TN
Contact:

Re: I can't get the <update> mechanism to work.

Post by ppetree » Sun Jun 09, 2024 8:59 pm

According to the docs here:
https://docs.joomla.org/J3.x:Creating_a ... ic_Module

Code: Select all

<name></name>
can be a translatable string and even pulled from the language.ini file

Then, according to the docs here:
https://docs.joomla.org/Special:MyLangu ... fest_files

Code: Select all

<name></name>
should be the component name but further down it uses plain english.

Then, according to the docs you posted earlier and found here:
https://jdocmanual.org/jdocmanual?artic ... fest-files

Code: Select all

<name></name>
Is plain english "Hello World Package"

I did change the updates->update->name to match the module manifest. Still no joy.

Also, according to the docs you posted earlier and found here (deploying an update server):
https://jdocmanual.org/jdocmanual?manua ... server.md It says in the update.xml that

Code: Select all

<name>
is required but it doesn't say it has to match anything

Further down, under

Code: Select all

<target_platform>
there's this line:
"For example, the following matches versions 4.0.0 and 4.0.1." but there is no "following" example.

A little further down from there under the NOTE, there's this line "If you want to include version 3.10 you can use an | like this: . If you want to show the updates for all 3.8.x versions and all 3.10.x versions you can use" but there is no example of what to use for either "| like this:" or "versions you can use"

In running the custom logging and using the updater tag, I don't see that my update server is getting hit. That looks like it stopped and I've no idea why but if I check the mysql tables it shows the "last checked" timestamp to be set to the same value as all the others.

So, I've run through both sets of docs, mucked around with as much as I can muck around with and I've gotten nowhere.

I'm open to any other suggestions.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2817
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: I can't get the <update> mechanism to work.

Post by ceford » Mon Jun 10, 2024 11:31 am

Can you look in the #__updates table and see what is in the element field for your extension?

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2817
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: I can't get the <update> mechanism to work.

Post by ceford » Mon Jun 10, 2024 4:03 pm

there's this line:
"For example, the following matches versions 4.0.0 and 4.0.1." but there is no "following" example.
The original conversion of MediaWiki markdown to GitHub markdown left out many tags <likeso>. I had to go through and add them back manually. Mea culpa!

I have been revising one of my earlier tutorials to add an update server and changelog. You can have a look at it to see if it helps: https://github.com/ceford/j4xdemos-com-countrybase

Look at countrybase.xml in the root and in the com_countrybase folder.

ppetree
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Wed Nov 13, 2013 7:43 pm
Location: Knoxville, TN
Contact:

Re: I can't get the <update> mechanism to work.

Post by ppetree » Wed Jun 12, 2024 3:16 pm

I've doubled checked the name across all the xml vs the update and it's the same: GeoTracker - Shows The Latest Visitors On A Google Map

##_updates: has no entries for this module
##_update_sites: I verified all of the update site urls and they're pulling the correct update.xml
##_update_sites_extensions: I double checked the id's match the update sites table entry versus the module id

Somehow, according to the process defined in the docs, mine is getting ruled out.

Where is the actual update.php stored in the system? Seems like adding some logging statements might be the best strategy at this point.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2817
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: I can't get the <update> mechanism to work.

Post by ceford » Wed Jun 12, 2024 3:53 pm

Something to check: go to System / Manage / Extensions and look for your extension. The version number comes from the manifest_cache field in the #__extensions table.

Look in administrator/components/com_installer/src/Model/DatatbaseModel.php line 505

I m not sure if that is the right place to look but it should be a good place to start.

ppetree
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Wed Nov 13, 2013 7:43 pm
Location: Knoxville, TN
Contact:

Re: I can't get the <update> mechanism to work.

Post by ppetree » Wed Jun 12, 2024 4:00 pm

Got it! Man! What a process!

In reading through the docs for the 1011th time and double checking the updateservers tag I noticed that servertype was set to "module" and not "extension" so I changed that. No joy.

Then I rebuilt the update server. No Joy.

Then, on a whim and mostly out of pure frustration and because I had tried everything else under the sun, I clicked on my module and then did a "check-in" and guess what, my module showed up in the update list and updated.

So, I moved to the next site and just rebuilt the update server and did a check-in and nothing. So I updated that site's xml's servertype to extension and did a check-in and still no joy. But, rebuilding the update server and doing a check-in worked.

In the update servers there is nothing to indicate that an extension/plugin/module is checked out.

I will update the git repository around 1p.

@ceford - I really, sincerely appreciate all your help and advice!

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2817
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: I can't get the <update> mechanism to work.

Post by ceford » Wed Jun 12, 2024 5:44 pm

Good show! Any thoughts on how the docs could be revised to make the process clearer?

ppetree
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Wed Nov 13, 2013 7:43 pm
Location: Knoxville, TN
Contact:

Re: I can't get the <update> mechanism to work.

Post by ppetree » Wed Jun 12, 2024 8:08 pm

Lots of them! LOL

In all of the tracks, the high level examples don't match the details of the low-level examples.

Mostly, in one track of the docs (i.e. How To Create A module)
https://docs.joomla.org/J3.x:Creating_a ... sic_Module

The basic inline documentation shows one thing and then the details show another.

As an example (using the above link to the docs), scroll down to the section titled "Creating mod_helloworld.xml" and you see that code. Then click on the "manifest files" explainer link and it tells you the version element you just saw is no longer valid.

This same inconsistency is found throughout every aspect of the developer documentation.

When reading the updater docs, it should very clearly say "if this doesn't match, this won't happen!"

More importantly, to the entire joomla project, if you rebuild the updater links, why is it not showing something as checked out and if it's not checked out, what is the check-in resetting that people should know about?

Advertisement

Post Reply

Return to “Joomla! 4.x Coding”