Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The latest 1.x dev update produces the following error message whenever a FAQ page is accessed:
php,Notice: Undefined index: safe_value in theme_field_detailed_question() (line 1640 of /home/ww7ba/all-things-android.com/sites/all/modules/faq/faq.module).,notice,http://www.all-things-android.com/content/phone-codes-samsung-galaxy-s-iii,94.11.34.232,17/Jan 09:08
I never received this error in the past.
Comment | File | Size | Author |
---|---|---|---|
#20 | undefined_index-2175851-20.patch | 1.3 KB | artem0793 |
|
Comments
Comment #1
billsdesk CreditAttribution: billsdesk commentedToday, I noticed what could be a clue to the problem. Detailed Question is disabled in the form and display. Yet, when I edit a FAQ the Description text box briefly appears, and then is overlayed by the Detail Question text box.
I do use the Display Suite, but it never created a problem in the past. Every time a visitor accesses a FAQ, I get the PHP warning described in the previous message.
Comment #2
AlfTheCat CreditAttribution: AlfTheCat commentedHaving the exact sameissue. Did you ever solve this problem?
Comment #3
sah62 CreditAttribution: sah62 commentedI'm also seeing this notice in 7.x-1.0-rc3.
Comment #4
sah62 CreditAttribution: sah62 commentedI think I've figured out how to reproduce this and can confirm @billsdesk's observation.
I found that the PHP notice was appearing when I had "Allow long question text to be configured" enabled and I added a "Detailed question" to one of my FAQ nodes. When I do that, and then view my FAQ, the notice appears. If I remove the detailed question, disable "Allow long question text to be configured", and then view the FAQ there are no notices produced.
The safe_value values are supposed to be set during the execution of function faq_update_7002 in faq.install. Could it be that this update wasn't performed when I installed and enabled 7.x-1.0-rc3 using drush? "drush pm-update faq" says that everything is up to date.
Comment #5
berenddeboer CreditAttribution: berenddeboer commentedI'm seeing this issue as well, and on the faq-page page I only see the short questions, not the detailed questions as I have configured.
Comment #6
DrCord CreditAttribution: DrCord commentedsah62's: #4 - report and fix is correct.
Comment #7
r2coder CreditAttribution: r2coder commentedI experienced the same issue and was able to resolve by adding a 'isset' before the offending line. So it looks like this:
Looks like this was forgotten as the rest of code includes this protection.
Drupal: 7.34
FAQ: 7.x-1.0-rc3
Comment #8
loopy1492 CreditAttribution: loopy1492 commentedOh wow. Yeah. It also seemed to actually remove the data I'd inputted into the field as well for some of my FAQs! Not just disappearing from the list view but actually clearing out the content I'd put in. I had to go through and put all the detailed questions from the original content PDF I'd received from the client and put it in the short question field in order for them to show up properly. That was a lot of work.
Hope there's an update soon.
Comment #9
sah62 CreditAttribution: sah62 commentedI'm not seeing this issue in 7.x-1.0. Is anyone still seeing it after upgrading?
Comment #10
DrCord CreditAttribution: DrCord commentedI still get the warning after update to 7.x-1.0
Comment #11
annya CreditAttribution: annya commentedThe problem is following:
1. FAQ uses index 'safe_value' to show detailed question text.
2. In function text_field_load you can see that 'safe_value' exists only if
3. If you use filter in you text format that disables caching(for example you install module Token Filter) 'safe_value' won't be created.
4. Solution: use field_view_value instead of 'safe_value'. See attached patch
Comment #12
jerry CreditAttribution: jerry commentedPatch in #11 also works for me with 7.x-1.0.
Comment #13
dadderley CreditAttribution: dadderley as a volunteer commentedYup, me too.
Patch in #11 also works for me with 7.x-1.0.
Comment #14
sender CreditAttribution: sender commentedRunning into the same issue. Can this be merged?
Comment #15
richH CreditAttribution: richH commentedAlso +1 for merging this.
Comment #16
annya CreditAttribution: annya commentedHi, guys! I'm happy that patch in #11 helps you. But please read this one https://www.drupal.org/issue-queue/status
In general patch has to be in RTBC-status before committing. So if someone can do it, please review patch and if everything is ok, change status to RTBC.
Comment #17
sender CreditAttribution: sender commented@annya I've applied the patch and the problem seems resolved (no more error messages). No regressions so far. So, at least 4 persons benefited from this patch, so me thinks that 'reviewed & tested by the community' is appropriate!
Comment #18
pietrocap CreditAttribution: pietrocap commentedPatch in #11 also works for me with 7.x-1.0.
Comment #19
Jaypan CreditAttribution: Jaypan at Jaypan commentedThe patch in #11 also works for me for 7.x-1.1.
Comment #20
artem0793 CreditAttribution: artem0793 at AnyforSoft commentedMy patch resolves only notice needs to review all functions. In the future, I will highlight the time and do a more thorough research. On this time maybe this correct solution
Comment #21
pazhyn CreditAttribution: pazhyn as a volunteer and at AnyforSoft, Drupal Ukraine Community for AnyforSoft commentedComment #22
bobburns CreditAttribution: bobburns commentedLooks like I will have to downgrade to 7x-1.1 - I have the 2.0 alpha and it ONLY works when module is disabled - nothing when module is enabled and the permissions are all checked to "view". The blocks still do not work at all
Comment #23
pietrocap CreditAttribution: pietrocap commentedHi,
same problem in 7.x-2.x.
I was able to get rid of the warning following instructions as in #7
Comment #24
gg24 CreditAttribution: gg24 as a volunteer and at QED42 commentedSteps followed to test this bug:
1- Created four sample FAQ contents.
2- Accessed '/faq-page'.
3- Check recent logs.
Found no errors. Not able to reproduce it anymore.
Drupal 7.54, FAQ '7.x-1.x latest version'
Maybe this got resolved in some parallel issue.
Thanks!
Comment #25
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedComment #27
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commented