Update FAQ module to 4.7
Richard Eriksson - June 9, 2006 - 07:53
| Project: | Frequently Asked Questions |
| Version: | HEAD |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | stella |
| Status: | closed |
Description
Attached is a patch that updates the FAQ module to 4.7 compatibility. Note that I've included a _install hook, so faq.mysql should be unnecessary. Also, I approached fixing FAQ for mod_rewrite than http://drupal.org/node/67397 which uses the l() function. Since there are link anchors, I used the url() function instead, which means keeping some of the HTML in the module intact.
| Attachment | Size |
|---|---|
| faq.47.patch.txt | 3.8 KB |

#1
#2
I am getting some warnings after applying this patch and using this module under 4.7:
warning: include_once(./modules/faq/faq.module) [function.include-once]: failed to open stream: Permission denied in C:\Program Files\xampp\htdocs\mysite\includes\bootstrap.inc on line 487.
warning: include_once() [function.include]: Failed opening './modules/faq/faq.module' for inclusion (include_path='.;C:/Program Files/xampp/htdocs/mysite/modules/civicrm/;C:/Program Files/xampp/htdocs/alpinecounty/modules/civicrm/\packages;.;C:\Program Files\xampp\php\pear\') in C:\Program Files\xampp\htdocs\mysite\includes\bootstrap.inc on line 487.
Thanks for the patch!
#3
4.7 updates
fixed more of the links than the previous patches..
#4
In function theme_faq_highlights in my opinion there is an incorrect use of parameters for l() function. Using parameters in this way anchors are passed as querystring. Here is my patch:
if ($node->taxonomy) {$term = array_pop(array_keys($node->taxonomy));
- $output .= '<li>' . l($node->title, 'faq/show/' . $term, array(), '#q_' . $node->nid) . '</li>' . "\n";
+ $output .= '<li>' . l($node->title, 'faq/show/' . $term, array('title' => 'View the answer to question: ' . $node->title), $query=NULL,'q_' . $node->nid) . '</li>' . "\n";
#5
Please notice, in faq.module at aboute line 260-262:
$edit = '';if(user_access('administer nodes')){
$edit = ' ' . l('edit', 'node/' . $node->nid . 'edit');
}
have to be corrected to
$edit = '';if(user_access('administer nodes')){
$edit = ' ' . l('edit', 'node/' . $node->nid . '/edit');
}
to able to edit the answer.
#6
I noticed with this patch for 4.7 that when I 'create content', the 'faq' option doesn't appear in the menu. It appears in the list in the content field with the explenation, but it doesn't appear on the left.. It has the hook_node_info so I'm not sure what the problem is. Do other people experience this too?
<?php
/**
* Implementation of hook_node_info().
*/
function faq_node_info() {
return array('faq' => array('name' => t('faq'), 'base' => 'faq'));
}
?>
All that seems ok.. Anybody an idea?
#7
Hey halkeye, thanks for that patch, it works great. Though for anyone else looking to use it, make sure you apply that patch on the version that hasn't already been patched by Richard's patch.
Anyway, in all patches, I still came across the following error:
Unknown column 'n.teaser' in 'field list' query: SELECT n.nid, n.title, n.teaser FROM node n WHERE n.type = "faq" AND n.status = 1 ORDER BY n.created DESC LIMIT 5 in /######/includes/database.mysql.inc on line 121.To fix this, I simply removed the references to "teaser" in the theme_faq_highlight function.
Also, the comment `wmostrey` made about it showing up in the menu, I think this has to do the faq_form function, but I tried adding an entry 'add/node/faq' for which it still failed to show up in the menu. I guess we will have to make do for now.
#8
A drupal 4.7 version of this module has been released - version 4.7.x-1.0-1.
A drupal 5 version now also exists and it is substantially different from the previous versions - 5.x-1.0.
Cheers,
Stella
#9