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.
See this error on dev version released June 5, 2011.
This happens when smart paging is enabled and Manual page breaks are inserted with default configuration.
Comment | File | Size | Author |
---|---|---|---|
#29 | form_defaults-1179858-#16.patch | 2.01 KB | felixSchl |
#27 | form_defaults-1179858-#16.patch | 2.01 KB | felixSchl |
#17 | display_settings.png | 26.33 KB | arpeggio |
#2 | undefined_index_smart_paging_display_title_1179858_1.patch | 646 bytes | Ravi.J |
Comments
Comment #1
michele1375 CreditAttribution: michele1375 commentedI'm getting the same error with version released June 5, 2011:
Notice: Undefined index: smart_paging_title_display_suffix in smart_paging_field_attach_view_alter() (line 598 of /var/www/modules/smart_paging/smart_paging.module).
Comment #2
Ravi.J CreditAttribution: Ravi.J commentedAttached Patch
Comment #3
michele1375 CreditAttribution: michele1375 commentedPerfect, now it's working well! Thanks.
Comment #4
michele1375 CreditAttribution: michele1375 commentedComment #5
rickvug CreditAttribution: rickvug commented@michele1375 Only mark as fixed when the patch has been committed. Based on your positive test and the trivial nature of the patch I'm going to mark this one RTBC.
Comment #6
arpeggio CreditAttribution: arpeggio commentedThank you Ravi.J for the patch. The fix is already committed/pushed. Please use the dev version.
Comment #7
felixSchl CreditAttribution: felixSchl commentedProblem still persists with latest dev release. With latest dev release, pages also take so long to load that php complains it took to long. Plus suddenly my computer went slow and all resources are eaten up by something. Looks like an infinite loop or something :)
Comment #8
arpeggio CreditAttribution: arpeggio commented@felixSchl I recommend to create a new issue for the infinite loop problem and please provide more details how to replicate that issue. With my sites I didn't encounter any infinite loop problem using the dev version of Smart Paging.
Comment #9
felixSchl CreditAttribution: felixSchl commentedThanks arpeggio, I think the loop problem had to do with the order in which my filters processed the content, so this can be forgotten about again. I hope.
However, I still get an undefined index error when I try to configure the smart filter on a per view mode basis. The problem is in lines 597 to 602 in smart_paging.module when it tries to get the $display_settings['settings']['smart_paging_...'] entries. Again, it only shows up when you set the view mode of your content type to have custom settings for smart paging.
Comment #10
arpeggio CreditAttribution: arpeggio commented@felixSchl try to Home » Administration » Structure and click the Manage display of your content type and click the "Save" button.
Comment #11
felixSchl CreditAttribution: felixSchl commentedNope, no luck. Been trying that over and over and flushing the cache and all.
Am I the only one with this issue? Maybe some other modules are interfering?
Comment #12
arpeggio CreditAttribution: arpeggio commented@felixSchl try to go to admin/config/content/smart_paging and click "Save Configuration" button.
Comment #13
felixSchl CreditAttribution: felixSchl commentedThat doesn't help either. Funny enough the endless page loading times creep back up too now when I set it to "Use the settings below for every content of this content type" mode. The httpd.exe then eats up 95% of my CPU and I have no choice but to kill it and restart the Apache server. I guess I will just stick to "Show Smart Paging settings during content editing of this content type" for now which works fine...
Shall I open a separate bug report / help request?
Comment #14
arpeggio CreditAttribution: arpeggio commented@felixSchl first try to install fresh Drupal and enable Smart Paging module only. If the issue does not occurred then try to enable the other modules one by one until the you find the module that causes the infinite loop problem and might conflict with Smart Paging. Please open new issue for infinite loop problem. Thanks.
Comment #15
felixSchl CreditAttribution: felixSchl commentedI now setup a complete fresh install and added back all modules one by one and it is still working. This is really frustrating. Now I gotta take everything over I guess.. It seems that for some reasons my content type just won't set the display settings (in the non-fresh install) that Smart Paging is looking for, even if I do it explicitly in the display options.
Comment #16
felixSchl CreditAttribution: felixSchl commentedOk, I solved it. I placed a few dsm() in your code to understand what was going on and I think there might be a bug with setting defaults.
The $bundle_settings array, retrieved in line 1015 of smart_paging.module, shows me that defaults are not being set for view modes that that have "custom_settings = FALSE" as I would expect. Not sure if it is supposed to, but as you can see it took me ages to figure that out and maybe could be prevented for others to happen.
In my case I had to literally walk through every display mode and make sure it is set correctly which sounds trivial, but contradicts the whole idea of using defaults.
Long story short: The "Full content"-smart paging options should adapt the "defaults" view mode if it has "custom_settings = FALSE" set, just like all other field display settings. Correct me if I am wrong. Edit: The "date" module shows the same behavior, so this might technically be by design and no bug, however confusing.
Another thing about undefined indices:
I recommend some validating on the submission of the "smart paging settings" form that appears in the "content type display settings" table. It let's you just leave everything blank and then gives you undefined indices errors on page loads.
Comment #17
arpeggio CreditAttribution: arpeggio commented@felixSchl "custom_settings = FALSE" does not apply to Smart Paging, it is a pseudo-field hence it has only two properties basically (visibility and weight). However, I force to add more properties that we need. Pseudo fields can be found under "extra_fields" if you use dsm(), check the image attachment. Notice that "settings" item have our Smart Paging properties we need that I forced to include. Its weird that I did not encounter any undefined index (I have a fresh installed Drupal, Smart Paging and created new content type).
Comment #19
Routh CreditAttribution: Routh commentedNotice: Undefined index: smart_paging_title_display_suffix in smart_paging_field_attach_view_alter() (line 599 of /sites/all/modules/smart_paging/smart_paging.module).
I'm still having this error occur in the lastest dev version of the module. I've manually set properties for every content type to try and work around it, however nothing I do (running cron, setting all settings, clearing cache multiple times) this error will not go away.
On some content, which seem to be only one page in length, the problem becomes worse:
Notice: Undefined index: smart_paging_method in smart_paging_field_attach_view_alter() (line 597 of /sites/all/modules/smart_paging/smart_paging.module).
Notice: Undefined index: smart_paging_pagebreak in smart_paging_field_attach_view_alter() (line 598 of /sites/all/modules/smart_paging/smart_paging.module).
Notice: Undefined index: smart_paging_title_display_suffix in smart_paging_field_attach_view_alter() (line 599 of /sites/all/modules/smart_paging/smart_paging.module).
Notice: Undefined index: smart_paging_title_suffix in smart_paging_field_attach_view_alter() (line 600 of /sites/all/modules/smart_paging/smart_paging.module).
Notice: Undefined index: smart_paging_character_count in smart_paging_field_attach_view_alter() (line 601 of /sites/all/modules/smart_paging/smart_paging.module).
Notice: Undefined index: smart_paging_word_count in smart_paging_field_attach_view_alter() (line 602 of /sites/all/modules/smart_paging/smart_paging.module).
Warning: explode(): Empty delimiter in smart_paging_field_attach_view_alter() (line 740 of /sites/all/modules/smart_paging/smart_paging.module).
Warning: array_filter() expects parameter 1 to be array, boolean given in smart_paging_field_attach_view_alter() (line 740 of /sites/all/modules/smart_paging/smart_paging.module).
Comment #20
Routh CreditAttribution: Routh commentedAs an additional note, in the case of the myriad of errors that come out when the content has only one page, the errors also seem to prevent ANY of the body from being displayed in these cases.
Here is an example of the single page issue:
http://amateurwriting.net/node/159
Comment #21
Routh CreditAttribution: Routh commentedComment #22
butler CreditAttribution: butler commentedI tried using 7.x-1.x-dev and continued to have the problems described above. This issue keeps getting closed and reopened, last time closed with no explanation - can anyone shed some light? Should I be using one of the patches above on the dev version, is supposed the dev version is working, or... ?
Comment #23
arpeggio CreditAttribution: arpeggio commentedThe patch above @comment #2 is already applied to dev version but the comment #19 needs to attend and find solution.
Comment #24
butler CreditAttribution: butler commentedOr maybe someone would be so kind as to explain to me where in the .module file the variable for sticking page numbers in titles is so I can just set it NULL or to " " or something?
Thanks...
Comment #25
butler CreditAttribution: butler commentedAround line 584 just aced this if statement and aside from the worst-practices approach, think I'm good:
Comment #26
Dean Clayton CreditAttribution: Dean Clayton commentedGetting the same issue with smart paging :
Notice: Undefined index: smart_paging_title_display_suffix in smart_paging_field_attach_view_alter() (line 599 of /var/www/vhosts/ux.newthing.co.uk/httpdocs/sites/all/modules/smart_paging/smart_paging.module).
I was running the latest release 7.x-1.2 and didnt have the issue.
I installed the dev release ( jun 25th 2011) to solve the issue with Smart paging hiding labels and I am now having the issue ( even with flushing cache).
Comment #27
felixSchl CreditAttribution: felixSchl commentedAnswering my own post #16.
I added a form validation function to fill in form elements that are empty with the default values.
I also added a one-off solution to get rid of the annoying "undefined index" errors. They occur because the $display_stored is used instead of $display_default - The condition to use $display_stored is met because it checks only if the settings array has been set for that view mode, but not if the settings array is complete. Upon enabling Custom Display Settings for other view modes, the settings array (strangely) only gets the "content_type" set (the fist key in the array). I could find no indication of it being explicitly set anywhere in smart_paging.module. So there seems to be some black magic going on or I am missing something. Maybe there is a missing hook to update the rest of the field settings when Custom Display Settings get enabled for a view mode?
Anyway, just checking for the size of the settings array to be greater than one works until the mystery is uncovered :)
Cheers,
Felix
Comment #28
austin_drupal CreditAttribution: austin_drupal commentedHi felixSchl - the attachment in #27 above is a broken link. Can you repost? Thanks.
Comment #29
felixSchl CreditAttribution: felixSchl commentedSure. No idea how that happened.
Edit: It just doesn't want to work. Uploaded it to PasteAll for now...
Comment #30
Dean Clayton CreditAttribution: Dean Clayton commented@FelixSchl I'm assuming your patch doesn't resolve the issue detected at comment 19?
Comment #31
felixSchl CreditAttribution: felixSchl commented@Dean Clayton
The added if logic in the elseif statement near the bottom of the patch should take care of that. But then it probably won't fix it for content that has already been created with missing elements, no. That should not happen in the first place imo. At least it makes it easier to fix them up afterwards because it pre-populates the formatter edit form with the default values.
Comment #32
offerman CreditAttribution: offerman commentedPatch works for me (on version 7.x-1.3). -- edit: NOT
Or that's what I thought: it worked for a short while (a few reloads, since this site is not yet in production), and then the same message was back again.
Flushing the cache doesn't make a difference.
I installed the current dev version (2011-Nov-01), patched it, and it is still there:
Notice: Undefined index: smart_paging_title_display_suffix in smart_paging_field_attach_view_alter() (line 613 of .../drupal-7.9/sites/all/modules/smart_paging/smart_paging.module).
Applying the patch on a reverted version 7.x-1.3 does not repair it for a second time: after clearing the caches, still the same message...