Here is the error I get when trying to install the dev version:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'FaqAccessTestClass-class' for key 'PRIMARY': INSERT INTO {registry} (name, type, filename, module, weight) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4), (:db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9), (:db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14), (:db_insert_placeholder_15, :db_insert_placeholder_16, :db_insert_placeholder_17, :db_insert_placeholder_18, :db_insert_placeholder_19), (:db_insert_placeholder_20, :db_insert_placeholder_21, :db_insert_placeholder_22, :db_insert_placeholder_23, :db_insert_placeholder_24), (:db_insert_placeholder_25, :db_insert_placeholder_26, :db_insert_placeholder_27, :db_insert_placeholder_28, :db_insert_placeholder_29); Array ( [:db_insert_placeholder_0] => Faq_AskTestCase [:db_insert_placeholder_1] => class [:db_insert_placeholder_2] => sites/all/modules/faq_ask/faq_ask.test [:db_insert_placeholder_3] => faq_ask [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => FaqAccessTestClass [:db_insert_placeholder_6] => class [:db_insert_placeholder_7] => sites/all/modules/faq_ask/faq_ask.test [:db_insert_placeholder_8] => faq_ask [:db_insert_placeholder_9] => 0 [:db_insert_placeholder_10] => CreateFaqTestCase [:db_insert_placeholder_11] => class [:db_insert_placeholder_12] => sites/all/modules/faq_ask/faq_ask.test [:db_insert_placeholder_13] => faq_ask [:db_insert_placeholder_14] => 0 [:db_insert_placeholder_15] => FaqExistsFaq_AskTestCase [:db_insert_placeholder_16] => class [:db_insert_placeholder_17] => sites/all/modules/faq_ask/faq_ask.test [:db_insert_placeholder_18] => faq_ask [:db_insert_placeholder_19] => 0 [:db_insert_placeholder_20] => CRAUDFaq_AskTestCase [:db_insert_placeholder_21] => class [:db_insert_placeholder_22] => sites/all/modules/faq_ask/faq_ask.test [:db_insert_placeholder_23] => faq_ask [:db_insert_placeholder_24] => 0 [:db_insert_placeholder_25] => BlockFaq_AskTestCase [:db_insert_placeholder_26] => class [:db_insert_placeholder_27] => sites/all/modules/faq_ask/faq_ask.test [:db_insert_placeholder_28] => faq_ask [:db_insert_placeholder_29] => 0 ) in _registry_parse_file() (line 179 of /includes/registry.inc).
CommentFileSizeAuthor
#18 rename_classes-1024560-1.patch1 KBaagbsn

Comments

stenjo’s picture

I am aware of the recent development in the Frequently Asked Questions module. However, I unfortunately have very little time to attend to developing the D7 version. I will make an effort to find time to apply patches and commit the dev line and keep it updated if dev work is done by others.
Thank you for your contribution so far.

GStegemann’s picture

May this is of help? I just removed the these entries from registry table and the install completed.

boftx’s picture

Why would the entries be there in the first place in a clean install of D7 and FAQ? I'll dig deeper based on what you said, but the names of the values having 'Test' in them gives me pause. Ah, such is dev.

boftx’s picture

Just on a hunch I removed the .test file from the files[] array in the .info file (commented it out) and it installed okay.

Permissions were able to be set. The first error I encountered was a WSOD related to the unanswered questions block, I forced a NULL return at the start of the block function to get past that on a temporay basis.

The next error I encounted was that the function drupal_goto() needs its query argument in an array, with each term being in an array as well. Here are my diffs so far (the original file is in the SAVE dir):

diff faq_ask.module SAVE/faq_ask.module 
181,182c181
< // JGB  drupal_goto('node/add/faq', 'ask=TRUE');
<   drupal_goto('node/add/faq', array('query' => array('ask'=>'TRUE')));
---
>   drupal_goto('node/add/faq', 'ask=TRUE');
204,205c203
< // JGB      drupal_goto("node/$node->nid/edit", 'ask=TRUE');
<         drupal_goto("node/$node->nid/edit", array('query' => array('ask'=>'TRUE')));
---
>       drupal_goto("node/$node->nid/edit", 'ask=TRUE');
1506,1508d1503
< // JGB Added this to prevent a WSOD when unanswered block is enabled.
<   return NULL;

When making custom changes to code like this I typically put my initials in a comment so I can quickly find my changes. Hope this helps. Will continue to try to track other errors, such as the WSOD when trying to preview or save a question from the FAQ Ask page. It seems to be connected to the form alteration.

GStegemann’s picture

Just to confirm the changes you made to drupal_goto.

Next I found that the taxonomy vocabularies are not displayed on the FAQ Ask page. This seems to be related to the changed function taxonomy_get_vocabularies().

boftx’s picture

I saw the categories displayed correctly, but I am encoutering a WSOD related to the alter_form_id_hook so far as I can tell. Also, the regular FAQ module add content page throws a WSOD with FAQ_Ask is enabled when trying to preview or submit a question and answer. The error is being thrown by the field module, but I am guessing it can be tracked back to the same issue that is throwing the FAQ_Ask error connected to forms.

Edit: Here is the error on the WSOD connected to previewing/saving in FAQ Ask:
Fatal error: Function name must be a string in /includes/form.inc on line 1390

boftx’s picture

Hee is the diff that resolves the WSOD when previewing/saving:

280,282c278,279
< // JGB This step is not needed as the value is ALREADY an array in D7
< // JGB   $temp_val = $form['#validate'];
< // JGB    $form['#validate'] = array($temp_val); // not needed
---
>     $temp_val = $form['#validate'];
>     $form['#validate'] = array($temp_val);

The problem came about because the value in $form['#validate'] is already an array if set, so no need to transform it again.

Now that I am past this I am getting a regular error message regarding fields, which seems to be the same one I get in FAQ with FAQ Ask enabled, so more fun and games.

Here is that message:

    * Warning: array_values() [function.array-values]: The argument should be an array in _field_filter_items() (line 494 of /modules/field/field.module).
    * Warning: Invalid argument supplied for foreach() in text_field_validate() (line 120 of /modules/field/modules/text/text.module).
boftx’s picture

Here is another bug that showed when I tried to unpublish a new question from the content admin screen:

Notice: Undefined property: stdClass::$revision in faq_update() (line 280 of /sites/all/modules/faq/faq.module).
boftx’s picture

To stenjo, GStegemann and future readers of these comments: Please forgive my somewhat ugly diffs and code postings. While I am no stranger to using Drupal or coding in other languages, I am new to PHP and Drupal code developing. You could say I'm old school. :)

stenjo’s picture

About time i chip in: The error you had initially was probably related to the .test file. All modules (if I have understood this correctly) must have a .test that will be run automatically on every commit of patches or code.
You are doing great I can see. Keep on the good work and tell me if its time to do any updates to the D7-dev version.
@boftx: You are forgiven :-)

GStegemann’s picture

I have not seen these error messages yet. But I have another one when I attempt to save a new question:

Fatal error: Function name must be a string in /var/www/html/cm7/includes/form.inc on line 1390
boftx’s picture

That fatal error is corrected by the changes in my comment #7 above. The changes are made in faq_ask.module. There is actually a better way to do the logic, but I wanted to leave as much of the old structure intact to make finding it easier.

bellagio’s picture

Can somebody make a patch file or tell me how to apply diff file? Or show me the code of changed .module file?

I've use Cygwin to patch a file, but i can't figure out what to do with diff file.(i read http://drupal.org/patch/apply but no luck)
Thank you.

boftx’s picture

Bump because it looks like CiviCRM is going to have a working port to D7 in the next couple of months. The lack of a D7 version of CiviCRM has been a major show stopper for me on the political organization sites I run. But once that is in place, then the lack of other modules like this one will become a block point.

I presume D6 will be at end-of-life once D8 comes out, so there is pressure to move to D7 within 12 months or so. However, D6 is very robust and many of what I would call key modules are not working on D7 yet. I consider FAQ and FAQ_ask to be among those key modules.

I have gone about as far as I can on this for now given my time constraints. I believe the module maintainer has real-life circumstances to deal with as well. Can someone step up and finish the job of getting a stable, bug-free D7 version of FAQ and FAQ_ask in place so migrating to D7 is one step closer for many of us?

steinmb’s picture

Priority: Normal » Critical

Still see this and it is critical.

mudtraining’s picture

Subscribe

mcncyo’s picture

subscribe

aagbsn’s picture

StatusFileSize
new1 KB

this error is raised because the 'faq_ask' has 2 class names that conflict with names in 'faq':
FaqAccessTestClass, CreateFaqTestCase. I renamed these to Faq_AskAccessTestCase and CreateFaq_AskTestCase.

kmonty’s picture

Status: Active » Needs review

Subscribing.

aagbsn’s picture

aagbsn’s picture

boftx: split one of your issues to another ticket: https://drupal.org/node/1277186

boftx’s picture

aagbsn: thanks, I'm not the most knowledgable on how the drupal ticket system works, I just try to make things work anyway I can. :)

stenjo’s picture

Assigned: Unassigned » stenjo

Brilliant. There is a lot of updated in patches now, and I'll see if I can find some time tonight to update the 7.x-dev version with the patches that are submitted.

stenjo’s picture

Patch in #18 is applied to 7.x-dev

stenjo’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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