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.
I was having difficulty creating a sub-page based on a field of type "Long text and summary". It was telling me there was no index for "text_default" (or something like that? I'm sorry; I don't have the error in front of me). The error was on line 111 of plugins/node_subpages_content/field.inc. I replace line 111 with:
111 $formatter_options = array();
112 $temp = $values['options'][$field_name];
113 if(isset($temp[$formatter])) {
114 $formatter_options = $values['options'][$field_name][$formatter];
115 }
The old line 111 is line 114 above. This is now working, and the subpage is working fine now.
Comments
Comment #1
BrockBoland CreditAttribution: BrockBoland commentedFixed in http://drupalcode.org/project/node_subpages.git/commit/4eb05b3
This was just a notice about an undefined index, so it didn't break anything, but it's irritating. I tweaked your solution a bit:
$values['options'][$field_name]
will always be set, it was$values['options'][$field_name][$formatter]
that sometimes isn't. This happens when the chosen formatter doesn't have any other options, like if you select Default for the Long Text with Summary field. Other formatters (like Trimmed) have some options (like the number of characters to trim at), and this notice wasn't thrown for those.Comment #2
BrockBoland CreditAttribution: BrockBoland commented(I guess I was supposed to put that last comment here. Still getting the hang of the new d.o)
Anyway, this fix will be in the next release.