Closed (fixed)
Project:
Link checker
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Nov 2011 at 10:18 UTC
Updated:
17 Feb 2015 at 18:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
wojtha commentedThis patch should fix these notices.
Comment #2
hass commentedAny reason that you are not using empty()?
Comment #3
hass commentedhttp://drupalcode.org/project/linkchecker.git/commit/8b29a7c
http://drupalcode.org/project/linkchecker.git/commit/ac5ba7b
I've changed the patch for the first lines a bit. Thank you very much for the patch!
Comment #4
wojtha commented@hass: isset() is sufficient in this case. It doesnt matter if the value is NULL, we just need to check if the array key exists.
Comment #6
johnbarclay commentedsame problem in 'text_with_summary' fields in linkchecker.module. While the value field is always populated, the summary is not.
- $text_items[] = _linkchecker_check_markup($item['summary'], $format, $entity->language, TRUE);
+ $text_items[] = isset($item['summary']) ? _linkchecker_check_markup($item['summary'], $format, $entity->language, TRUE) : NULL;
Comment #7
hass commentedMaybe a core bug #1300920: The [node:summary] token does not output anything for body fields without a manual summary
Comment #8
hass commentedHow can I repro this? I also have nodes with empty summary, but don't see a notice.
Comment #9
hass commentedCannot repro with Drupal 7.12.
Comment #10
dgtlmoon commentedI'm getting this error with Drupal 7.14 whilst running some Drush tests, however i'm not sure what the cause is just yet
linkchecker_parse_fields() failed: Undefined index: summary
Comment #11
hass commentedWhat are "some tests from drush"? I need a repro plan.
Comment #12
dgtlmoon commentedTurns out the drush warnings i was having was due to another test that was using drupalCreateNode and not setting a 'summary'
Comment #13
alan d. commentedDevel generate triggers these errors too.
This is triggered during save, so I would think that anything that passes field_is_empty() is valid input and needs to be handled here.
i.e.
This code throws notices: Notice: Undefined index: summary in _linkchecker_parse_fields() (line 1550 of sites\all\modules\linkchecker\linkchecker.module).
Format is checked, a vital text property, so I'm not sure why an optional property is not.
Comment #14
hass commentedType is text_with_summary, but summary is not set??? Sound like a webform bug...
Comment #15
alan d. commentedI have seen this with custom code, devel generate, randomly on save (I think field permissions were in play)... It is one of the few remaining issues in a "base install" I'm working on, with a mere 150 modules....
Comment #16
hass commentedYeah, but there must be something wrong. The field type is
text_with_summaryand this means there need to be a summary. Otherwise it should betext_longortext. Maybe devel generate has a bug or webform has...How can I reproduce this reliable? It is 100% caused by webform? webform 3 or webform 4?
Comment #17
alan d. commentedCustom code example above will generate a 100% PHP notice. Node type is irrelevant. On 50 nodes, I get about 30 warnings from Devel Generate, probably as it randomly sets about 30 teasers.
Note. Justification for this can also be found in core:
i.e. Even core does not trust that the summary value is set.
Comment #18
hass commentedCode wise I would say we do not need this line, isn't it?
Comment #19
hass commentedExtended this a bit and committed http://drupalcode.org/project/linkchecker.git/commit/799ee7c
Could you test this, please?
Comment #20
alan d. commentedAt the point within the code, a dpm() shows correct field format, and no more errors in Devel generate :)
Thanks
Comment #22
jelo commentedThis issue still persists. I just ran into, but have trouble pinpointing it. My suspicion is that it might have to do with nodes that have been created through feeds module. My importer set the body field for a content type, but nothing for the summary. Are you saying that every time a field "text plus summary" is set programmatically or through a module (such as feeds or rules), the summary needs to be set at the same time, otherwise this error will show?