Problem/Motivation

The module Update Status Advanced Settings includes settings that are quite helpful for legacy D6 sites and would be a useful addition to D6LTS. In particular, it includes:

1. Option to "Check for updates of disabled and uninstalled modules and themes" providing immediate overview of all modules and themes on a platform. This is also a feature the Drupal 7 core update status module includes.

2. The advanced settings can be used to selectively exclude specific modules and themes from update checking and allows for brief notation of reason for exclusion.

Steps to reproduce

The existing update_advanced-6.x-1.1 module will not work with D6LTS because it has a dependency on d6 core update_status module that must be disabled for the mydropwizard (status) module.

Proposed resolution

The proposed solution is to patch the update_advanced module to use hook_mydropwizard_status_alter() hook. This was done in a sandbox project described in comment #5 and was further tested and patched as described in comment #9. It is compatible with php 7.3 and appears to handle the new status flag (UPDATE_NOT_SECURE_AND_NOT_SUPPORTED) which isn't in the update module, that could be a little tricky to get right.

Subsequent discussion suggests the best way to proceed is to directly patch the update_advanced module with patch ready for review.

Remaining tasks

The existing update_advanced module needs to be forked and can be patched for mydropwizard as discussed in this issue so that it can be added to the D6LTS project with a new version number.

User interface changes

The update settings page, with the update_advanced module, includes additional advanced settings.

API changes

None.

Data model changes

None.

Comments

dsnopek created an issue. See original summary.

jerry’s picture

I agree that this would be a useful feature. The advanced settings are quite helpful for legacy D6 sites.

hargobind’s picture

@dsnopek Can you explain your thoughts around achieving this, and what a conceptual solution might look like? I'm willing to write a patch, or even possibly refactor the update_advanced (UA) module to use myDropWizard (MDW) hooks if necessary. But first I want to understand the issue correctly.

From what I understand, the only change that UA makes to the status of a project is done via update_advanced_update_status_alter(), and that function simply changes the status to UPDATE_NOT_CHECKED when the user chooses to ignore a project. How does that behavior need to change in order to accommodate the additional flag that MDW adds?

dsnopek’s picture

Patching update_advanced would be the easier option! It could just implement the hook_mydropwizard_status_alter() hook and do it's thing. We could even make a forked version of update_advanced and put it in our update status data, if the maintainers aren't interested in making a new D6 release (we did that for 'hacked'). If you want to help with that, please let me know!

The issue here is about coming up with a way for the mydropwizard module to call hook_update_status_alter() and have it work right in all cases, which is much trickier.

hargobind’s picture

Have a look at my sandbox project https://www.drupal.org/sandbox/hargobind/2958765. It's a fork of the update_advanced module, and it includes MDW hooks. I modified the code with the intention to merge the changes back into update_advanced. But in the event that their maintainers don't want to support these changes, I'm happy to hand it over to you to integrate into MDW.

hargobind’s picture

Category: Bug report » Feature request
Status: Active » Needs review

I've been running the sandbox "update_status" fork module for the last 2 weeks on 2 production sites, and so far so good! I suggest you give it a try.

I don't have a need right now to put more development time into it, so I'm happy to give you the code if you want to move forward with it... either requesting to integrate it into the original "update_status" module, or fold it into MDW.

dsnopek’s picture

Sure, please share the code!

hargobind’s picture

You can grab it from the sandbox link -- https://www.drupal.org/project/2958765/git-instructions

izmeez’s picture

StatusFileSize
new10.43 KB

The update_advanced_mydropwizard from the sandbox in comment #8 has been written to work with the d6 core update module (update status) for historically outdated drupal 6.38 and earlier or with mydropwizard, however, for this to work it requires a minor fix in update_advanced_settings.inc as follows:

function update_advanced_settings_submit($form, &$form_state) {
+  global $mdw;
+
  unset($form_state['values']['data']);
  unset($form_state['values']['available']);

  // See if the update_advanced_check_disabled setting is being changed, and
  // if so, invalidate all cached update status data.
  $check_disabled = variable_get('update_advanced_check_disabled', FALSE);
  if ($form_state['values']['update_advanced_check_disabled'] != $check_disabled) {
+    if ($mdw) {
+      mydropwizard_invalidate_cache();
+    }
+    else {
      update_invalidate_cache();
+    }
  }
}

Attached is the module with this change.

Alternatively, the module could be patched to only support mydropwizard and this could be added as a dependency in the .info with removal of the conditionals in several places throughout the code for when mydropwizard is not present.

Either way, this module can be very helpful to show what other disabled modules and themes are present and to disable checking specific modules and themes and eliminating unnecessary email notices.

izmeez’s picture

My two cents on the extra features provided by the update_advanced module are:

1. The addition of option to "Check for updates of disabled and uninstalled modules and themes".

This is most valuable for immediate insight as to all modules and themes on a platform. It is also the one extra feature that the Drupal 7 core update status includes. If this were added to the mydropwizard module it may be sufficient.

2. The added options to selectively determine which modules and theme versions to check and make notes on why is a nice extra.

The update_advanced module provides both of these.

izmeez’s picture

Title: Support hook_update_status_alter() so modules like update_advanced work unpatched » D6LTS update_advanced module ready to apply
Issue summary: View changes
izmeez’s picture

Project: myDropWizard » Drupal 6 Long Term Support
Version: 6.x-1.x-dev »

Moving to the D6LTS issue queue.

hargobind’s picture

Thanks @izmeez. I have incorporated your changes from #9.

My sandbox module has been running on 2 production sites for the last couple of years and has worked flawlessly.

@dsnopek Would you like to incorporate any of these changes in the myDropWizard module, or shall I release my sandbox as a full-fledged module?

izmeez’s picture

@hargobind Thanks for your work on this issue, it was nice to find this done.

Depending on what @dsnopek decides and your decision on whether to release as a full-fledged module have you considered that https://www.drupal.org/project/update_advanced is looking for co-maintainer(s) which would help the D7 branch get to a full release to be covered by security reviews while you could still wrap in the contribution to D6 and maybe consider what to do for D8/D9.

hargobind’s picture

Thanks @izmeez.

I realize that my sandbox module's name is also "update_advanced.info/module" which conflicts with the main UA module, so it may not be clear to users that they have to first remove the existing UA module from /sites/all/modules/ and then add the sandbox one. The reason why it's the same is because I intended to hand the code over to @dsnopek to maintain under https://github.com/d6lts as a LTS version of the UA module per #4.

I love the idea of taking over maintenance of the update_advanced module and integrating these changes. I use UA for every site I build/maintain. However I lack the time right now. But I'll put it on my calendar to consider sometime in the next couple months unless @dsnopek adds my sandbox code into the D6LTS github project space first.

izmeez’s picture

To move this issue forward I have attached a patch to the update_advanced 6.x-1.x-dev module using the sandbox created by @hargobind with the fix in comment #9. This may make it easier for @dsnopek to review and consider forking and adding the module to the D6LTS project. Anyone else interested can just apply the patch to the update_advanced module.

While creating the patch I found the README.txt file from the sandbox and in the custom module attached in #9 is somehow a binary file so it was removed leaving the original README.txt from the update_advanced module and thus not included in the patch.

hargobind’s picture

A patch is a great idea for people looking to download the module and patch it themselves rather than install a new sandbox module.

It looks like your patch was generated from version 6.x-1.x-dev on the project release page.

For those wishing to download update_advanced via the git repo directly, I'm attaching a patch that applies to the 6.x-1.x-dev git branch, and it includes the changes to README.txt.

izmeez’s picture

@hargobind Unfortunately, your patch does not work with our workflow.

Our workflow uses drush make with mydropwizard for D6LTS

$ drush --release-backend=mydropwizard rl update_advanced
returns

Project          Release      Date         Status                 
 update_advanced  6.x-1.x-dev  2013-Oct-19  Development            
 update_advanced  6.x-1.1      2009-Oct-04  Supported, Recommended

It is not clear where the files are coming from when using $ drush --release-backend=mydropwizard dl update_advanced.

The files are dated 2011-02-24 which corresponds with the commits at https://git.drupalcode.org/project/update_advanced/-/commits/6.x-1.x but, the files are different at https://git.drupalcode.org/project/update_advanced/-/tree/6.x-1.x where the LICENSE.txt file has already been removed. It is not clear why the drush dl with mydropwizard is not getting the same results.

Other than the LICENSE.txt file having been removed in the git repo, the only other difference is that the .info file does not have the information added by the packaging script:

; Information added by drupal.org packaging script on 2013-10-19
version = "6.x-1.1+2-dev"
core = "6.x"
project = "update_advanced"
datestamp = "1382149970"

that causes your patch to fail when used with drush make. This is the major obstacle.

Further examination of your patch identifies two minor typos. One, previously missed and in the sandbox, is in the comment:

+ * Implementatsion of hook_init(). 
should be 
Implementation of hook_init().

and the second is the possible need for an extra blank line for formatting consistency (coding standards?)

 function update_advanced_settings_submit($form, &$form_state) {
+  global $mdw;
+

The biggest problem is how to deal with the .info file in the patch.

izmeez’s picture

Attached is a patch and interdiff with a minor change to the README.txt along with fix to the typos. The LICENSE.txt file is omitted from the patch because it is not needed and without it focus can be directed to the pertinent changes. This patch is against the latest update_advanced-6.x-1.x-dev and will work with drush make. It will fail against the git repo because of the issue related to patching the .info file.

The real point of this patch is to consider a slight variation to the README.txt changes. The proposed change is that the first paragraph read:

The "Update status advanced settings" module extends the administrative
interface for Drupal core's "Update status" module and has been extended for
notifications through the "myDropWizard" module for Drupal 6 Long-Term Support.
It provides additional configuration options on the "Settings" tab of the
"Available updates" report, located at: admin/reports/updates/settings

and the credits be shortened to fit 80 characters as follows:

Original module written by: Derek Wright ("dww") http://drupal.org/user/46549
Modified for myDropWizard by: Hargobind https://www.drupal.org/user/216765

izmeez’s picture

Issue summary: View changes
izmeez’s picture

StatusFileSize
new1.21 KB

Here is a proper interdiff_17-19.txt, ignore the one attached in comment #19. Unfortunately, it is not complete in that it does not show the correction of the typo:

--- a/update_advanced.module
+++ b/update_advanced.module
@@ -13,6 +13,33
- * Implementatsion of hook_init().
+ * Implementation of hook_init().

Maybe, because it hit the .info hunk failed issue.

izmeez’s picture

StatusFileSize
new1.85 KB

Ok, this is a proper and complete interdiff of the patches in comment #17 and #19. The patchutils interdiff previously failed because of the .info hunk.

izmeez’s picture

Title: D6LTS update_advanced module ready to apply » [update_advanced] module ready to apply to D6LTS

Thanks to @hargobind for the original work. The patch in comment #19 applies to the latest update_advanced-6.x-1.x-dev and works with D6LTS. This module is very useful to help show the status of modules that may not be supported or that have patches.

The https://www.drupal.org/project/update_advanced module 6.x-1.x-dev branch will need to be forked and the patch applied for D6LTS.

Just bumping this up to get more eyes on it.

dsnopek’s picture

Status: Needs review » Fixed

I'm sorry it's taken so long to get back to this! Thanks to @hargobind and @izmeez for keeping this alive :-)

I've made a fork of update_advanced, applied the patch from #19, added a couple changes of my own (I didn't like the $mdw global) and it's available here:

https://github.com/d6lts/update_advanced

It's working great in my testing!

I'll make a release when I'm doing the big round of releases for all the stuff I've been committing lately.

izmeez’s picture

@dsnopek Thanks very much. It is obvious you are doing a big sweep and preparing for a bunch of releases that's why I thought I'd bump this up. Thanks for the great work.

izmeez’s picture

@dsnopek Thanks for all your work on the issue queue including this module. Can you add it to the releases so it shows with
drush --release-backend=mydropwizard rl update_advanced

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.