Even when new pageranks were retrieved the information in column 'Last Checked' seems to be never updated.

However, the module attempts to update this information in table 'weblinks_pralexa' but fails due to an incompatible column data type. Currently the column last_checked is defined as 'int', but the modules code expects dates as strings in the form 'Y-m-d H:i:s'. After changing the data type to 'varchar(32)' the information in column 'Last Checked' is displayed correctly.

I've changed the modules schema definition in the D7 development version. Second I have implemented an update hook to update an already existing table.

Comments

jonathan1055’s picture

Component: Contrib: Pralexa » Code
Issue summary: View changes

Hi Gerhard,
Now that we have dropped the Pralexa sub-module in 7.x can this issue be closed? Or does it still need fixing at 6.x?

jonathan1055’s picture

Component: Code » Contrib: Pralexa (D6 only)

Sorry I did not mean the component to change. Had to reselect as the text is different now.

GStegemann’s picture

Or does it still need fixing at 6.x?

I would say yes.

To fix this the corresponding change in D7 can be applied here as well.

jonathan1055’s picture

Title: Column 'Last Checked' always shows '0 seconds' » Pralexa column 'Last Checked' always shows '0 seconds'
Version: 6.x-2.5 » 6.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new1.88 KB

In Web Links 6.x the table weblinks_pralexa has already been corrected via a hook_update pralexa_update_6101 to change the column last_checked to type 'datetime' and this is working fine. It was done at 6.x-2.0 so it may have been noticed during and fixed during the 1.0 to 2.0 development.

However, the schema definition was not changed to keep it in line, so clean installs of 6.x have the field still defined as 'int' and the problem persists. The schema definition needs to be kept up to date with all the changes made via hook_updates so that a new clean install has the same table definition. Here's a patch which does that.

Also this I made two other minor corrections, directly related to testing this page rank retrival. First in admin.inc for the show/hide pagerank setting the default value was not causing either radio button to be selected because it needs (int). Second, in pralexa.module _pralexa_getpagerank we need to check the result with isset() otherwise PHP5 throws warnings. I know it is not good to have multiple fixes in the same patch, but these are fairly small and I do not intend to do too much to the pralexa module given that we've dropped in in 7.x, so fixing these bugs here, as we wont be starting a separate issue or separate commit for them :-)

GStegemann’s picture

Status: Needs review » Reviewed & tested by the community

However, the schema definition was not changed to keep it in line

Oops, I missed that.

I know it is not good to have multiple fixes in the same patch

That's pretty OK here.

Tested and works. Thanks. However, I didn't test a fresh install of Web Links 6.x.

  • jonathan1055 committed c6ab2fb on 6.x-2.x
    Issue #1964318 by jonathan1055, GStegemann: Pralexa column 'Last Checked...
jonathan1055’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new266.97 KB

That's OK, I already tested on a clean fresh install, and check the table definition in phpMySQL against one with the update function having run. The tables are identical.

Thanks for marking RTBC

Status: Fixed » Needs work

The last submitted patch, 4: 1964318_4.pralexa.last_checked_datetime.patch, failed testing.

jonathan1055’s picture

Status: Needs work » Fixed

The issue is fixed. Old patch from #4 got automatically requeued, and obviously it fails to apply because the code change is already committed in #6.

Status: Fixed » Closed (fixed)

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