When loading a page containing the default ptoc block, I have had this error:

Notice : Undefined index: title dans template_preprocess_node() (/var/www/html/htdocs/core/modules/node/node.module ligne 616)

Commenting the template_preprocess_ptoc_node(&$variables) circumvents this error.

Drupal 8.5.4
Paragraphs 8.x-1.3

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dakwamine created an issue. See original summary.

saurabh.dhariwal’s picture

Status: Active » Needs review
FileSize
456 bytes

@Dakwamine, I also got the same error as shown above, in my attached patch I provide the solution to remove this error. Can you please try with my patch. Let me know your views for the same.

Thanks!..

jhereck’s picture

Your patch is not working saurabh.dhariwal.

jhereck’s picture

Status: Needs review » Active
jhereck’s picture

Status: Active » Needs work
benjifisher’s picture

Status: Needs work » Needs review
FileSize
713 bytes

Note the code comment in ptoc.module:

/**
 * Implements template_preprocess_HOOK().
 *
 * Call default preprocess function.
 * According to the docs on hook_theme(), this should not be needed.
 */
function template_preprocess_ptoc_node(&$variables) {
  template_preprocess_node($variables);
}

I think that problem was fixed in #2559825: Preprocess functions from base hooks not triggered for theme hooks not using the __ pattern, so I can just remove the two preprocess functions.

Please try the attached patch.

jhereck’s picture

It's working !

Thanks

  • benjifisher committed 68a2a75 on 8.x-1.x
    Issue #2979629 by saurabh.dhariwal, benjifisher, jhereck, Dakwamine:...
benjifisher’s picture

Status: Needs review » Fixed

@jhereck:

I will take that comment as the equivalent of RTBC. Next time, please update the issue status to make it official. Standards for contrib modules, especially those with small user bases like this one, are lower than for Drupal core.

Thanks to everyone who participated on this issue!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.