When accessing a non existing page, with bigpipe enabled, i get following notice.

Notice: Undefined offset: 2 in Drupal\big_pipe\Render\BigPipe->sendPreBody() (line 142 of modules/big_pipe/src/Render/BigPipe.php).

Comments

mallezie created an issue. See original summary.

Wim Leers’s picture

Assigned: Unassigned » Wim Leers

Thanks for the bug report! Working on reproducing…

mallezie’s picture

I had it on a clean drupal 8 install. When i enabled devel. The problem did not happen anymore. Perhaps this can help.

Wim Leers’s picture

Title: Notice on page not found » PHP notice on page not found (when JS is disabled)
Priority: Normal » Minor
Status: Active » Postponed (maintainer needs more info)

I cannot reproduce this. What's missing from the IS, is that this only happens in case there are no-JS placeholders to be sent, which generally is only when JS is disabled. But even then I can't reproduce this.


The code triggering this PHP notice looks like this:

list($pre_scripts_bottom, $scripts_bottom, $post_scripts_bottom) = explode('<drupal-big-pipe-scripts-bottom-marker>', $pre_body, 3);

To trigger the PHP notice that you're seeing, there can be nothing after $post_scripts_bottom. Quick script to prove this:

list($a, $b, $c) = ['a', 'b'];

Running this script reproduces the problem.

But, I do not succeed in getting that last part to be empty. It almost certainly means you're using a custom theme. Because this marker by definition lives before the closing body tag, and I don't see how it could be empty with core's themes:

  …
  [99% of the HTML lives here]
  …
<drupal-big-pipe-scripts-bottom-marker>
  </body>
</html>

So: are you using a custom theme?

mallezie’s picture

Thanks for the investigation.
It happened on bartik for me. But when reinstalling D8 i also can't reproduce the problem. My guess is some strange combination of alpha-version test modules created this combination.
Sorry for the confusion, should have tested on a more clean environment.

mallezie’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)
Wim Leers’s picture

Category: Bug report » Support request
Status: Closed (won't fix) » Closed (cannot reproduce)

Thanks for the swift confirmation!

Berdir’s picture

Status: Closed (cannot reproduce) » Active

Re-opening, I have the same with 8.1.0-beta1 and big_pipe in core.

I had the same on an access denied page. Specifically, I was on /admin/people and used masquerade to switch to a user without an special permissions. Notice persists on page reloads.

As far as I can tell, doesn't exist at all in the $pre_body string.

The same happens on 404 pages. Normal pages work fine.

I have a large number of modules enabled, this is our install profile. @Wim, if you contact me, we can try to debug this together.

Wim Leers’s picture

Status: Active » Closed (duplicate)
Related issues: +#2679867: BigPipe causes PHP notices with JavaScript disabled on error pages

Ah, yep, @mr.baileys reported the same as #8 at #2679867: BigPipe causes PHP notices with JavaScript disabled on error pages. Thanks to his detailed report, I was able to fix it. #8 matches his description exactly. Therefore, tentatively closing this as a duplicate. If #8 turns out to be a different bug (i.e. if #2679867 doesn't fix it), feel free to reopen this!