Ticket #8881 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

Discrepencies in title of one module between test and live servers

Reported by: cbearden Owned by: jccooper
Priority: critical Milestone: Hot Fixes
Component: Content Viewing Version: Dev
Severity: severe Keywords: gentext
Cc: kef, ew2, reedstrm, jenn System Area: Content Display
Primary Skill: Zope
Site URL: http://cnx.org/content/m19863/1.27/
Suppress email to reporter: no

Description

I ran my test of 500 randomly selected modules comparing wakizashi 8080 with live, and aside from the expected differences, I found that the title of a module changed between the two

On wakizashi, version 1.27 of m19863 has the title "An Overview of a Unified Theory of a Law", as it does on my dev instance. However, on live, version 1.27 of the same module has the title "There is a Hole in your Legal Education". In both cases, the "Overview" title is what is found in the CNXML. /module/title in module_export_template, however, differs (waki has "Overview", live has "Hole"). The title attribute for 1.27 of this module gives the same answer on both machines, but the Title() method gives a different answer:

Live (claymore/cnx2)
>>> m19863 = app.plone.content.m19863['1.27']
>>> m19863.title
'An Overview of a Unified Theory of a Law'
>>> m19863.Title()
'There is a Hole in your Legal Education'
>>> 

Test (wakizashi/cnx)
>>> m19863 = app.plone.content.m19863['1.27']
>>> m19863.title
'An Overview of a Unified Theory of a Law'
>>> m19863.Title()
'An Overview of a Unified Theory of a Law'
>>> 

My dev instance mimics waki.

Note that 1.27 is not 'latest' on live, but it is on the test and dev instances. Note also that the code in content_render.xsl that sets the title (both for the browser title bar and for the h1 element) is unchanged in this branch.

The difference is evident whether the module is viewed in our out of collection context.

Both Jenn and I independently came to suspect some difference in how 'latest' and non-latest modules are treated. It looks to me like something Cameron should take a look at.

Change History

  Changed 8 years ago by cbearden

  • keywords gentext added
  • severity changed from major to severe

in reply to: ↑ description   Changed 8 years ago by jenn

  • status changed from new to accepted

Replying to cbearden:

Both Jenn and I independently came to suspect some difference in how 'latest' and non-latest modules are treated. It looks to me like something Cameron should take a look at.

However, if you compare, e.g., version 1.26, the difference shows up there too, even though 1.26 isn't "latest" on either machine.

  Changed 8 years ago by jccooper

"There is a Hole in your Legal Education" is the title of 1.28 on live. From 1.1 to 1.27 it was "An Overview of a Unified Theory of a Law".

The Title method retrieves the title from the content catalog, if possible, which means it comes out of the ZODB instead of the RDB, which the title attribute does.

It appears that the 'Title' method does not take into account the current version of the module; it just picks up the first result from a catalog query on id::

mod = cat(objectId=self.objectId)
if mod:
   return mod[0].Title

We only keep the 'latest' record in the content catalog. So, clearly, doing this for non-latest modules is a bug.

follow-up: ↓ 7   Changed 8 years ago by jccooper

  • cc kef, ew2, reedstrm, jenn added
  • status changed from accepted to working

Copying hot-fix interested parties. I think perhaps it makes the most sense to slip this into the gentext devset, since it'll be out soon and it doesn't seem to be hot enough to have to go immediately. (After all, it's been like this since dbstorage, 5 mos ago: r24721.)

I wonder if this is what was really behind r25420. Ross? Probably not; I think that was in the other direction.

  Changed 8 years ago by jccooper

Indeed; simple tests confirm that older versions of modules use the current name. I will provide a fix.

  Changed 8 years ago by jccooper

(In [27603]) branch RhaptosModuleStorage? for bug with module title; see #8881

in reply to: ↑ 4   Changed 8 years ago by cbearden

Replying to jccooper:

Copying hot-fix interested parties. I think perhaps it makes the most sense to slip this into the gentext devset, since it'll be out soon and it doesn't seem to be hot enough to have to go immediately. (After all, it's been like this since dbstorage, 5 mos ago: r24721.)

That sounds good to me.

  Changed 8 years ago by jenn

Yes, go ahead and commit, and I'll test it right away. I'm hoping to get gentext out this afternoon or evening.

  Changed 8 years ago by jccooper

  • status changed from working to testing

(In [27606]) Do not do catalog lookup for title if the MmoduleView? in question is not the latest one, since the catalog doesn't store data for historical modules. In doing so, refactor the control structure a little to be a bit neater. Fix #8881

  Changed 8 years ago by jccooper

(In [27607]) add RhaptosModuleStorage? for fix to module title bug; see #8881

  Changed 8 years ago by jccooper

This doesn't have its own milestone, so I will note it is packaged with #8753.

  Changed 8 years ago by jccooper

(In [27609]) changes ref #8881

  Changed 8 years ago by jenn

  • status changed from testing to closed
  • resolution set to fixed

Rolled out 4/16.

Note: See TracTickets for help on using tickets.