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.
Hi all,
What's this notice about?
Notice: Undefined offset: 0 in views_pdf_plugin_style_unformatted->render_grouping_sets() (line 48 of /sites/default/modules/views_pdf/views_pdf_plugin_style_unformatted.inc).
thanks :)
Comment | File | Size | Author |
---|---|---|---|
#29 | views_pdf-php-notices-2042927-29.patch | 2 KB | Peacog |
#27 | views_pdf-php-notices-2042927-27.patch | 2.02 KB | Peacog |
#24 | views_pdf-notices_views_pdf-2042927-24.patch | 1.04 KB | Alex Arnaud |
#15 | 2042927-notices_views_pdf-11.patch | 950 bytes | UJF-DiSI-Drupal |
#10 | 2042927-notices_views_pdf-10.patch | 394 bytes | guillaumev |
Comments
Comment #1
killua99 CreditAttribution: killua99 commentedThis is an old code. Can you update to the lasted one? You're using group fields, right? Should be a bad call or setup.
Please update to the lasted 1.x one and test it again.
Comment #2
candelas CreditAttribution: candelas commentedi get a similar notice with the last dev and i use unformated style
Message Notice: Undefined offset: 0 in render_grouping_sets() (line 48 of /xxx/sites/all/modules/contrib/views_pdf/views_pdf_plugin_style_unformatted.inc).
Comment #3
elsteff1385 CreditAttribution: elsteff1385 commentedI'm using the latest version: 7.x-1.0+25-dev
This is the format setup:
Format: PDF unformatted
Show: PDF Fields
Issue remains, same like candelas
Comment #4
killua99 CreditAttribution: killua99 commentedOk so we have a NOTICE message there to clean up.
Thanks for the report guys.
Comment #5
candelas CreditAttribution: candelas commentedi also get
Notice: Undefined variable: pdf_display in render() (line 158 of /xxx/sites/all/modules/contrib/views_pdf/modules/views_view_field/views_view_field_handler_include_view.inc).
Comment #6
elsteff1385 CreditAttribution: elsteff1385 commentedafter updating to 7.x-1.0+26-dev, 2 additional notices pop up:
Notice: Undefined offset: 0 in views_pdf_plugin_style_unformatted->render_grouping_sets() (line 48 of /sites/default/modules/views_pdf/views_pdf_plugin_style_unformatted.inc).
Notice: Undefined index: bypass_eval_before in PdfTemplate->renderRow() (line 496 of /sites/default/modules/views_pdf/views_pdf_template.php).
Notice: Undefined index: bypass_eval_after in PdfTemplate->renderRow() (line 530 of /sites/default/modules/views_pdf/views_pdf_template.php).
Comment #7
candelas CreditAttribution: candelas commentedmmm i think that this notices come depending what we are doing. maybe we can put the options that we are using...
for this notice:
Message Notice: Undefined offset: 0 in render_grouping_sets() (line 48 of /xxx/sites/all/modules/contrib/views_pdf/views_pdf_plugin_style_unformatted.inc).
i just realized that if in "Format: PDF unformatted | Settings" i dont get a grouping field, i get the notice. if i put a grouping field, i dont.
for this notice:
Notice: Undefined variable: pdf_display in render() (line 158 of /xxx/sites/all/modules/contrib/views_pdf/modules/views_view_field/views_view_field_handler_include_view.inc).
i use a field from a view. i have in that view only the master, not other displays. trying to debug, i have included other view as a field. i choosed a view with different displays besides the master. i save it without going to "Show: PDF Fields | Settings" and then i got the
for my experience in views_pdf 6.x i remembered that it didnt run well if i didnt open and save "Show: PDF Fields | Settings" before saving the view. so i did it and the bypass_eval_before and after was gone.
and for my surprise, now i only get one Undefined variable: pdf_display in render() (edit: i have deleted the included view with displays)
can the people that have warnings test this, please? :)
Comment #8
candelas CreditAttribution: candelas commentedi correct the name because they are notices from different files but all with the unformatted style.
Comment #9
killua99 CreditAttribution: killua99 commentedThanks for the report guys. I have to dig with this notices.
Comment #10
guillaumev CreditAttribution: guillaumev commentedThis patch should fix the bypass_eval_before and bypass_eval_after notices.
Comment #11
stevieb CreditAttribution: stevieb commentedpatch works here --- thanks
Comment #12
killua99 CreditAttribution: killua99 commentedSo stevieb say it's works... Lets put this patch into RTBC ... and wait 1 week to push it into 1.x and 2 weeks to release it as stable. ok?
Comment #13
stevieb CreditAttribution: stevieb commentedoops spoke too soon - error still there - although no longer in notice ... in error logs
Comment #14
killua99 CreditAttribution: killua99 commentedAnyways this patch has to be commited.
Issue #2042927 by guillaumev | elsteff1385: Fixed notices in style unformatted.
Need revisions ...
Comment #15
UJF-DiSI-Drupal CreditAttribution: UJF-DiSI-Drupal commentedHello,
I had the same message about the bypass unfounded vars.
After testing the first patch, I confirm it didn't solve the problem.
I read the file and I propose the following patch.
I change in line 496 and 530 the 'bypass_eval_before' and 'bypass_eval_after' vars in 'eval_before' and 'eval_after'.
No more messages are now noticed by my Drupal site.
F.T.
Comment #16
killua99 CreditAttribution: killua99 commentedDid you try the last dev branch? ...
Ok first at all. You didn't see what was the problem. $options['render']['eval_after'] $options['render']['eval_alter'] I commit the patch with this typo ... test the last dev branch. and tell me if this work.
Comment #17
TwilightSparkle CreditAttribution: TwilightSparkle commentedPatches by guillaumev and by UJF-DiSI-Drupal don't work for me. I'm waiting for better solution.
Comment #18
killua99 CreditAttribution: killua99 commented@TwilightSparkle
Which version are you?
Which notice are you seen?
Comment #19
darkodev CreditAttribution: darkodev commentedI made the following change and works for us (just added checks for isset() around $options['render']['bypass_eval_before'])
Comment #20
ellen.davis CreditAttribution: ellen.davis commentedI'm using views_pdf 7.x-1.x-dev (2013-Sep-11)
I get this notice in the log.
Notice: Undefined offset: 0 in views_pdf_plugin_style_unformatted->render_grouping_sets() (line 48 of .../sites/all/modules/views_pdf/views_pdf_plugin_style_unformatted.inc).
line 48:
Line 48 is in this section of code:
Using dpm, I found that in my case:
$set['group'] is set to empty string
$this->options['grouping'] is empty array
Grouping field is none in my view's settings.
Not sure how to fix though.
Comment #21
sportel CreditAttribution: sportel commentedI'm also having these error messages:
I'm using the latest dev version of Views PDF.
Comment #22
killua99 CreditAttribution: killua99 commentedOk those are related with the submodule Views view field. I'll open another issue with this one. to make it simple to handle the issue stuff.
Comment #23
killua99 CreditAttribution: killua99 commentedOk now you can follow this issue #2098305: Notice and strict warning. with relations of notice.
This will be fixed on the next version. If I want to make a new version aviable I can't fix this ones without patchs because I'm full focus on the next one. If some of you can provide patchs for this notice on the v1 version will be really nice and I can test it really quick.
You can get a lot of info how to make patchs.
http://www.wunderkraut.com/blog/how-to-create-a-patch-for-a-drupal-modul...
https://drupal.org/patch
https://www.youtube.com/watch?v=pFLLDQFC8yo
https://duckduckgo.com/?q=drupal+make+a+patch&t=canonical
So contribute.
Comment #24
Alex Arnaud CreditAttribution: Alex Arnaud commentedI have the same notices:
Notice: Undefined index: bypass_eval_before in PdfTemplate->renderRow()
Patches above didn't solve the problem.
Here is a patch that works for me.
Comment #25
killua99 CreditAttribution: killua99 commentedAwesome, I'll test it soon.
Comment #26
CvW CreditAttribution: CvW commentedreplace
by
That works for me.
Comment #27
Peacog CreditAttribution: Peacog commentedHere's a patch that fixes the following errors:
Notice: Undefined offset: 0 in render_grouping_sets() (line 49
andNotice: Trying to get property of non-object in renderRow() (line 412
I've also included Alex's patch from #24 which fixes
Notice: Undefined index: bypass_eval_before in PdfTemplate->renderRow()
Comment #28
killua99 CreditAttribution: killua99 commentedThis code
The empty verify if isset aswell, can you fix it?
if ($key === NULL |
It not better use empty?
if (isset($options['render']['bypass_eval_before']) && !empty($options['render']['eval_before'])) {
Same here, it's not better use empty?
Fix it and I'll commit it after test this patch.
Comment #29
Peacog CreditAttribution: Peacog commentedNo problem - patch has been updated.
Comment #30
killua99 CreditAttribution: killua99 commentedthe first empty maybe case some fails? I was thinking on !empty
Comment #31
Peacog CreditAttribution: Peacog commentedWe need to check for empty because sometimes $key is empty. When renderRow is called in drawTable at line 695, $key is not passed in, so it's null. If we don't check for empty $key here, we get the Notice: Trying to get property of non-object in renderRow() error.
Comment #32
killua99 CreditAttribution: killua99 commentedI still thinking in this result.
if (TRUE or FALSE)
becase if key is empty case TRUE
but this !empty($view->field[$key]...) == FALSE
in that case, I'm wrong?? Maybe I'm tired to see it.
Comment #33
killua99 CreditAttribution: killua99 commentedComment #34
Peacog CreditAttribution: Peacog commentedIf $key is empty the if statement is true and the function returns without checking the rest of the if statement. If we don't check for empty($key) and $key is empty, then the next part of the if statement throws a php notice because we're trying to use a null variable as an array key.
The logic of renderRow() seems to be saying that if $key is null, we should return nothing. I don't know the code well enough to say if that makes sense or not.
Comment #35
scott.allison CreditAttribution: scott.allison commentedPatch in #29 fixed several issues for me.
Comment #36
killua99 CreditAttribution: killua99 commented4061c5a65141