If you try to browse by date without the project_releases.module you get the following error:

user warning: Table 'tablename_projects.project_release_nodes' doesn't exist query: SELECT COUNT(DISTINCT(n.nid)) FROM node n INNER JOIN node_revisions nr ON n.vid = nr.vid INNER JOIN project_projects p ON n.nid = p.nid LEFT JOIN term_node r ON n.nid = r.nid INNER JOIN project_issue_projects pip ON n.nid = pip.nid INNER JOIN project_release_nodes prn ON n.nid = prn.nid WHERE n.status = 1 AND r.tid = 17 in /var/www/drupal-5/includes/database.mysql.inc on line 172.

Comments

ac’s picture

Status: Active » Closed (works as designed)

I see you can actually turn of this type of browsing in the admin so I imagine this is by design.

aclight’s picture

Title: Browse by date does not work without project_releases.module » Browse by date does not work without project_release and taxonomy modules
Version: 5.x-1.2 » 5.x-1.x-dev
Status: Closed (works as designed) » Active

Even if you can turn off browse by date, I wouldn't call this by design. It also looks like this query will break without having the taxonomy module installed. There's a similar taxonomy related issue for the project releases module itself at #133052: remove project_release dependency on taxonomy.

aclight’s picture

Status: Active » Needs review
StatusFileSize
new3.79 KB

In project_page_overview(), there are several checks for the project_release_browse_versions variable. Unfortunately, if that variable is TRUE, but project releases is not enabled (which could be the case if it was enabled at some point but later disabled), project_page_overview() just goes along as if the project_release module was there, and I think that's what's causing stuff like what's reported here. I wasn't actually able to reproduce this database error, so I'm not certain which part of the function is the culprit, but it could be one of several places.

The attached patch adds in additional calls to module_exists() to make sure the project release module is enabled when the project_release_browse_versions variable is checked.

While testing this I also noticed that when browsing by date without the project release module installed, the Date values that are printed in h3 tags are bogus, because there is no timestamp pulled from the database if project releases isn't enabled. Though this is sort of a separate issue, it's just a small fix and I don't want to have too many issues about this one function because that makes keeping track of all of the patches more difficult.

I've tested this on MySQL and don't see any problems.

I don't know that we should spend a ton of time trying to fix this function with the port to views on the near horizon. But if someone wants to review/test this, that would be great.

ac’s picture

Successfully applied to 5--1-2 and fixes the original issue. I also get the bogus timestamp.

aclight’s picture

@ac: You get the bogus timestamp before applying this patch but it is fixed by the patch, or you get a bogus timestamp even with this patch?

ac’s picture

No timestamp prior to patch, bogus one after the patch.

aclight’s picture

The patch will pull the timestamp from the changed time of the project node itself if project_releases isn't enabled. Are you seeing different behavior with the patch applied? If so, what timestamp is it getting?

ac’s picture

With the patch applied I get one date, and it is UNIX epoch time. It then lists the projects in the correct order (according to 'sort by date') under that time . If a project that is not the most recent is edited, it becomes the most recent after editing (but still under the UNIX epoch date).

ac’s picture

StatusFileSize
new137.7 KB
hunmonk’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.76 KB

attached removes a couple of unnecessary hunks due to fixes in a previous patch, and uncomments the code that makes the date thing work correctly. tested with project_release disabled and enabled, works perfectly.

dww’s picture

Status: Reviewed & tested by the community » Fixed

Reviewed, tested, and committed to HEAD and DRUPAL-5. Thanks, folks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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