Will not work in 6.2
jcbrew - April 17, 2008 - 01:37
| Project: | Archive |
| Version: | 6.x-1.0 |
| Component: | Page |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
I can not seem to get my 6.2 Drupal install to recognize the Archive module. Is there a way to get it to work or do I have to wait for a new version... I have it working nicely in my 6.1 site, but I would like to upgrade to 6.2. Or does anyone have a suggestion on something else that will work in 6.2.

#1
Does anyone know if Archive is supposed to work with Drupal 6.2?
#2
Of course archive is supposed to work with 6.2, but it seems like it doesn't as of right now. I believe it is due to permissions, though I don't have time to make a proper patch.
#3
I hope you can fine some time soon... In the meantime can you point to a module that will do the same thing? I like the way yours works but I need to finish a current project by early next week.
Thanks
#4
I think this is the problem. I'm not sure what specifically "does not recognize" means in terms of Drupal, as I would think the module just isn't showing up in the list of available modules. The only problems caused by 6.2 would be not being able to view the administration settings page for this module.
In terms of fixing access to the different pages, the archive_menu() function needs to be fixed changed. It should look like the following.
function archive_menu() {$items = array();
$items['archive'] = array(
'title' => 'Archives',
'access arguments' => array('access content'),
'page callback' => 'archive_page',
'file' => 'archive.pages.inc',
'type' => MENU_SUGGESTED_ITEM
);
$items['admin/settings/archive'] = array(
'title' => 'Archives',
'description' => 'Select the content types listed in the archives.',
'page callback' => 'drupal_get_form',
'page arguments' => array('archive_admin_settings'),
'access arguments' => array('access administration pages'),
'file' => 'archive.admin.inc',
'type' => MENU_NORMAL_ITEM
);
}
Does this work for you?
#5
I sort of got it to work. I was able to get it to show ALL the pages on the site. I would like to designate what aticle types to display and what not to... Basically I don't want the pages to show up and I want the stories and other dynamic types to be displayed...
Here is a sample of the archive page:
http://216.227.221.146/index.php?q=archive/all/2008
Drupal 6.2
Windows
IIS 6
MySQL 5
PHP 5
Maybe the right question should be : "How do I Configure the Archives Module?"
The only place I see any reference to it is in the Module page - where I can enable/disable it...
#6
Did you try the code fix I proposed in #4? That should fix this issue.
#7
I will give it a try. I'll see if that helps my access to the administration settings page. Our messages crossed...
Thank You
#8
where can I find the archive_menu() function?
I searched all the files in the views folder...
BTW - Thank you for the quick replies.
#9
It will be in the PHP source file, archive.module, which should be in the modules/archive directory.
#10
After I made the change - I am now getting a The page cannot be found error...
http://216.227.221.146/index.php?q=archive/all/2008/
I did it a couple of times switching back and forth and the old one always allowed me to view the archives - but not the admin settings.
#11
Alright, but can you view the administrative settings page at /admin/settings/archive once you've applied the change?
#12
No, I can't see it
#13
Are you logged in as user 1 or someone with administration permissions?
That change should've made the archive administration pages visible. The archive page should always be visible so long as you have the "Access content" permission...
#14
Yes, I am logged in as user one...
I went to admin/settings/archive and did not see the page - just the site configuration page.
http://216.227.221.146/index.php?q=admin/settings/archive
#15
So tell me the following:
1) Can you access /archive without the change?
2) Can you access /admin/settings/archive without the change?
3) Can you access /archive with the change?
4) Can you access /admin/settings/archive with the change?
#16
1) Can you access /archive without the change? Yes But I get "No Content Found"
However - when I view archive/all/2008/... I get all the articles on my site.
2) Can you access /admin/settings/archive without the change? Yes - But I get Access denied
You are not authorized to access this page.
3) Can you access /archive with the change? - No
4) Can you access /admin/settings/archive with the change? - No
I am logged in as user 1 - Administrator
#17
I'm not quite sure what's going on...
The no content found is probably because the content types haven't been defined correctly on the settings page, so that makes sense.
What doesn't make sense is that you can't access the settings page before the change or after it. As user 1 you should be able to bypass all access checks and be able to access everything.
I can only think of asking in IRC to see if anyone knows or in the forums.
#18
Just wanted you to know that this module works in 6.1... not sure what happened in 6.2. But, it's not working properly. I will wait to upgrade my other Drupal install in hopes that someone can figure this out.
I've never used IRC and I've asked the question in the forums...
FYI - my content types are defined properly. Two of them are the Drupal Content Types Page and Story.
Thank you for your time and effort.
#19
I have attached a patch that solved it for me. Based the code off the fix to the fasttoggle module which caused the same issues for me - #248486: user 1 is denied access to admin/settings/fasttoggle.
Patch against standard 6.x-1.0.
#20
Thank you for the help... I've never installed a patch before. So to be sure - I install something like Cygwin onto my local windows machine and run the patch against the standard 6.x-1.0 module using Cygwin.
#21
Remember: Search is your friend.
For instructions on how to patch, see http://drupal.org/patch/apply
#22
I had the same issue with the 'Access Denied' error on 6.2
tried the patch first and got the following...
[root@Drupal5 archive]# patch < archive_6.2_menu.patch
patching file archive.module
Hunk #1 FAILED at 36.
1 out of 1 hunk FAILED -- saving rejects to file archive.module.rej
[root@Drupal5 archive]# cat archive.module.rej
***************
*** 36,41 ****
'description' => 'Configure which content types are listed in the archives.',
'page callback' => 'drupal_get_form',
'page arguments' => array('archive_admin_settings'),
'file' => 'archive.admin.inc',
'type' => MENU_NORMAL_ITEM
);
--- 36,42 ----
'description' => 'Configure which content types are listed in the archives.',
'page callback' => 'drupal_get_form',
'page arguments' => array('archive_admin_settings'),
+ 'access arguments' => array('administer archive'),
'file' => 'archive.admin.inc',
'type' => MENU_NORMAL_ITEM
);
However.. from the code posted in this thread by Susurrus, I compared his posted code to archive.module and noted a missing line, so I manually added the line:
'access arguments' => array('access administration pages'),
After this was added, I still received 'Access Denied'... HOWEVER... going to site building/module then disable archive, click 'save configuration', enable archive, click 'save configuration', then I see the Archive link listed in 'Site Configuration' and I'm able to see the settings for this module.
Suggested two cents worth of fixes:
First, to the Keepers of the Code... add the 'access arguments' line to the package that is available for download.
Second, for those of us daemons in the ether of Drupaldom... if you manually add this line to the module, you must disable the module fully, then re-enable it... and all should be creamy goodness. :)
Good Day,
Juggernaut
(From the movie of the same name)
#23
Alright, so looks like my suggestion was correct. Seems like menu caching prevented the permissions change in the code from being registered properly...
#24
I added the line you said to; disabled - saved config; then I enabled it - saved config. and still nothing.
I'm wondering if the patch you ran first actually fixed the problem and it didn't take effect until you disabled/enabled the module.
#25
The patch made no changes since the file sizes for the .orig file and archive.module were identical. I'll run a diff on the file when I get a chance, but I think its safe to say that since the patch application failed, no changes were made.
I can't recall if I did anything additional. I did change permissions of the modules directory to that of the apache process, just in case, but other mods work fine with their default (filesystem) permissions.
One other suggestion is to stop and restart the webserver process. You are running Windows so it might be something a little more systemic than my setup. I'm running Fedora 7 with Apache 2.2.0, PHP 5.2.4, mySQL 5.0.45.
Thoughts?
#26
I'm still unable to access the pages after the change. I must be doing something wrong. Here is the code I am using:
///////////////////////////////////////////////////////////
function archive_menu() {
$items = array();
$items['archive'] = array(
'title' => 'Archives',
'access arguments' => array('access content'),
'page callback' => 'archive_page',
'file' => 'archive.pages.inc',
'type' => MENU_SUGGESTED_ITEM
);
$items['admin/settings/archive'] = array(
'title' => 'Archives',
'description' => 'Select the content types listed in the archives.',
'page callback' => 'drupal_get_form',
'page arguments' => array('archive_admin_settings'),
'access arguments' => array('administer archive'),
'access arguments' => array('access administration pages'),
'file' => 'archive.admin.inc',
'type' => MENU_NORMAL_ITEM
);
}
//////////////////////////////////////////////////////////
I wasn't sure if I needed to keep both access arguments or replace the old one with the new one.
So, I also tried it with removing the 'access arguments' => array('administer archive'),
and replacing it with 'access arguments' => array('access administration pages'),
//////////////////////////////////////////////////////////
function archive_menu() {
$items = array();
$items['archive'] = array(
'title' => 'Archives',
'access arguments' => array('access content'),
'page callback' => 'archive_page',
'file' => 'archive.pages.inc',
'type' => MENU_SUGGESTED_ITEM
);
$items['admin/settings/archive'] = array(
'title' => 'Archives',
'description' => 'Select the content types listed in the archives.',
'page callback' => 'drupal_get_form',
'page arguments' => array('archive_admin_settings'),
'access arguments' => array('access administration pages'),
'file' => 'archive.admin.inc',
'type' => MENU_NORMAL_ITEM
);
}
////////////////////////////////////////////////////////////////////////////////////
#27
Okay after a little more playing around I finally got it to appear...
I had to add 'return $items;' to the bottom of the code.
//////////////////////////////////////////////////////
function archive_menu() {
$items = array();
$items['archive'] = array(
'title' => 'Archives',
'access arguments' => array('access content'),
'page callback' => 'archive_page',
'file' => 'archive.pages.inc',
'type' => MENU_SUGGESTED_ITEM
);
$items['admin/settings/archive'] = array(
'title' => 'Archives',
'description' => 'Select the content types listed in the archives.',
'page callback' => 'drupal_get_form',
'page arguments' => array('archive_admin_settings'),
'access arguments' => array('access administration pages'),
'file' => 'archive.admin.inc',
'type' => MENU_NORMAL_ITEM
);
return $items;
}
////////////////////////////////////////
It wasn't in Susurrus' original fix....
#28
If you want to paste code into a comment, use <code> tags...
Looks like the correct code is below, sorry about that guys. I'll try to fix some issues today.
function archive_menu() {$items = array();
$items['archive'] = array(
'title' => 'Archives',
'access arguments' => array('access content'),
'page callback' => 'archive_page',
'file' => 'archive.pages.inc',
'type' => MENU_SUGGESTED_ITEM
);
$items['admin/settings/archive'] = array(
'title' => 'Archives',
'description' => 'Select the content types listed in the archives.',
'page callback' => 'drupal_get_form',
'page arguments' => array('archive_admin_settings'),
'access arguments' => array('access administration pages'),
'file' => 'archive.admin.inc',
'type' => MENU_NORMAL_ITEM
);
return $items;
}
#29
Apparently you were doing quite a bit of hacking... might have it been inadvertently deleted? (Wouldn't be the first time, I've done that too ;), the statement "return $items;" was in the original archive.module file...
I ran a diff on the archive.module file and the .orig generated by the patch attempt that failed:
[root@Drupal5 archive]# diff archive.module archive.module.orig
39d38
< 'access arguments' => array('access adminsitration pages'),
[root@Drupal5 archive]#
As you can see, this is the only statement that I added was out of Susurrus' posted code.
Here is the code from my archive.module before adding the line:
------------------
function archive_menu() {
$items = array();
$items['archive'] = array(
'title' => 'Archives',
'access arguments' => array('access content'),
'page callback' => 'archive_page',
'file' => 'archive.pages.inc',
'type' => MENU_SUGGESTED_ITEM
);
$items['admin/settings/archive'] = array(
'title' => 'Archives',
'description' => 'Configure which content types are listed in the archives.',
'page callback' => 'drupal_get_form',
'page arguments' => array('archive_admin_settings'),
'file' => 'archive.admin.inc',
'type' => MENU_NORMAL_ITEM
);
return $items;
}
--------------------
and after:
--------------------
function archive_menu() {
$items = array();
$items['archive'] = array(
'title' => 'Archives',
'access arguments' => array('access content'),
'page callback' => 'archive_page',
'file' => 'archive.pages.inc',
'type' => MENU_SUGGESTED_ITEM
);
$items['admin/settings/archive'] = array(
'title' => 'Archives',
'description' => 'Configure which content types are listed in the archives.',
'page callback' => 'drupal_get_form',
'page arguments' => array('archive_admin_settings'),
'access arguments' => array('access adminsitration pages'),
'file' => 'archive.admin.inc',
'type' => MENU_NORMAL_ITEM
);
return $items;
}
----------------------
Good job on getting it fixed. :)
Regards,
S.
#30
Committed. Thanks everyone.
#31
Automatically closed -- issue fixed for two weeks with no activity.