webtrees icon indicating copy to clipboard operation
webtrees copied to clipboard

Update ModuleCustomTrait.php

Open magicsunday opened this issue 3 years ago • 4 comments

Adding an additional method call to allow the processing of the response from the get latest version request. With this it would be possible for me to query the version information directly from githubs release json without the need for an exta latest-release.txt file. Using the method I could easily parse the JSON response and extract the version information.

magicsunday avatar Jan 07 '21 17:01 magicsunday

Do you got some time to look at this?

magicsunday avatar Jan 24 '21 09:01 magicsunday

I don't think this is necessary - why don't you just adjust customModuleLatestVersion() in your custom module, according to your specific needs? (Adjustments of that method are required anyway in case of a different versioning scheme, and/or a different cache expiration period, or should we have separate methods for these as well? I don't think so.)

ric2016 avatar Feb 20 '21 17:02 ric2016

Because of duplicate code. You should avoid it where ever it is possible. As "customModuleLatestVersion" is a method from the core there is always a possibility of change. Maybe it contains a bug, so it would require me to fix this in my module too but my module shouldn't know about the core. So intercepting the core code using a callback or hook would be the better solution instead of duplicating it. Currently the method only accepts a single solution of querying module information without greatly modifying it.

magicsunday avatar Feb 21 '21 10:02 magicsunday

Seems: will not be implemented->close

arbor95 avatar Feb 25 '24 08:02 arbor95