I just installed this in a Pressflow installation, and when I went to add my first FAQ entry (node/add/faq)

I get this error message "Notice: Undefined property: stdClass::$detailed_question in faq_form() (line 231 of /vol/var/www/sites/all/modules/faq/faq.module)"

I'm guessing this is because Pressflow uses strict error reporting.

Comments

stella’s picture

Version: 6.x-1.9 » 6.x-1.12
Status: Active » Postponed (maintainer needs more info)

I can't reproduce this. Is it still a problem?

stella’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No update to my question, so closing this issue. Feel free to reopen if the problem is still occurring.

stenjo’s picture

Status: Closed (cannot reproduce) » Active

Have the same problem. Even have the same issue when running simpletest:

sten@sten-ThinkPad-T420s:/var/www/d6$ drush test-run 'Frequently Asked Questions'
CRUD FAQ node 223 passes, 0 fails, and 6 exceptions                                 [error]
Test FaqTestCase->setupTaxonomy() failed: Undefined index: query                    [error]
Test faq_form() failed: Undefined property: stdClass::$detailed_question            [error]
Test faq_form() failed: Undefined property: stdClass::$detailed_question            [error]
Test FaqTestCase->setupTaxonomy() failed: Undefined index: query                    [error]
Test faq_form() failed: Undefined property: stdClass::$detailed_question            [error]
Test faq_update() failed: Undefined property: stdClass::$revision                   [error]
No leftover tables to remove.                                                       [status]
No temporary directories to remove.                                                 [status]
Removed 1 test result.                                                              [status]
Access to FAQ pages 83 passes, 0 fails, and 1 exception                             [error]
Test FaqTestCase->setupTaxonomy() failed: Undefined index: query                    [error]
No leftover tables to remove.                                                       [status]
No temporary directories to remove.                                                 [status]
Removed 1 test result.                                                              [status]
FAQ functionality 0 passes, 0 fails, and 0 exceptions                               [ok]
No leftover tables to remove.                                                       [status]
No temporary directories to remove.                                                 [status]
Removed 1 test result.                                                              [status]

Could it be something with the server setup?
Running Apache/2.2.20 (Ubuntu 11.10), PHP Version 5.3.6-13ubuntu3.6 and with clean urls enabled.

stella’s picture

Status: Active » Postponed (maintainer needs more info)

I can't reproduce with the latest version of the faq module (6.x-1.13) with PHP 5.2.5 and Apache 2. Can you try it with the latest version?

stenjo’s picture

StatusFileSize
new132.13 KB

Attached is a devel- snapshot of the parameters passed to the faq_form function when error occurs. Hope this might shed some light on the issue. Will try and investigate a little more on what is happening.

stenjo’s picture

Version: 6.x-1.12 » 6.x-1.x-dev

At line 354 in faq.module the following hook is defined:

/**
 * Implements hook_content_extra_fields().
 */
function faq_content_extra_fields($type_name) {
  $extras = array();

  if ($type_name == 'faq') {
    $extras['detailed_question'] = array(
      'label' => t('Detailed question'),
      'description' => t('FAQ detailed question field'),
      'weight' => 10,
    );
  }

  return $extras;
}

I cannot seem to find where the hook is called. There are no hook_content_extra_fields() in the core documentation
http://api.drupal.org/api/search/6/hook_content_extra_fields

stenjo’s picture

Status: Postponed (maintainer needs more info) » Patch (to be ported)
StatusFileSize
new718 bytes

A suggested fix (although I'm not sure if that only fixes the symptom rather than the root cause) is to replace the reference to
'#default_value' => $node->detailed_question,
with something like
'#default_value' => isset($node->detailed_question)?$node->detailed_question:'',
Patch attached

stella’s picture

Status: Patch (to be ported) » Fixed

hook_content_extra_fields() is a CCK hook. It declares the field to CCK so it can be re-ordered on the 'display fields' page.

I've committed the patch. I'm not sure why that field is undeclared but we might as well fix the error. Thanks!

stenjo’s picture

Thank you for the explanation. Did not check for the CCK hooks :-)
Have come across another related issue I suppose:
Notice: Undefined property: stdClass::$revision in faq_update() (line 262 of /var/www/d6/sites/all/modules/faq/faq.module).
Create similar fix on this one too?

stella’s picture

Done!

Status: Fixed » Closed (fixed)

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