Problem/Motivation

When installing a module via the UI, it looks like a whole HTML page is being returned at some point instead of just a JSON response. The actual error was on the next page:

User error: "data" is an invalid render array key in element_children() (line 6009 of core/includes/common.inc).

Proposed resolution

pass the message in an array with the #markup key.

Remaining tasks

  1. (done in #13) Patch needs to be reviewed.

User interface changes

None.

API changes

None.

Original report by jenlampton

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jenlampton’s picture

Title: An AJAX HTTP error occurred. » An AJAX HTTP error occurred during module installation via UI
Project: » Drupal core
Version: » 8.x-dev
Component: Twig templates conversion (front-end branch) » update.module
Priority: Normal » Major

Nevermind, it looks like this is a core issue. Not related to our sandbox :)

jenlampton’s picture

Issue summary: View changes

add more words

tim.plunkett’s picture

Status: Active » Needs review
FileSize
773 bytes

The actual error was on the next page:
User error: "data" is an invalid render array key in element_children() (line 6009 of core/includes/common.inc).

dcam’s picture

http://drupal.org/node/1427826 contains instructions for updating the issue summary with the summary template.

The summary may need to be updated with information from comments.

alimac’s picture

I'm going to work on updating the issue summary.

alimac’s picture

Issue summary: View changes

update to match core instad of sandbox

alimac’s picture

Updated issue summary.

alimac’s picture

Issue summary: View changes

Updated issue summary to use template.

YesCT’s picture

Issue summary: View changes

added related, maybe duplicate

valthebald’s picture

Issue summary: View changes
Issue tags: +needs relevance check, +Needs reroll

Tagging

mgifford’s picture

2: drupal-1885788-2.patch queued for re-testing.

Anonymous’s picture

I've tried to reproduce the issue, but wasn't able to. It's likely that this is no longer relevant.

There is no need for a reroll, since the patch still applies.

The issue marked as related is about an out of memory exception, whereas this is about an issue while rendering. I don't think they are related.

jhedstrom’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Patch no longer applies. From what I can tell this will still be an issue:

function theme_authorize_message($variables) {
  $message = $variables['message'];
  $success = $variables['success'];
  if ($success) {
    $item = array('data' => $message, 'class' => array('authorize-results__success'));
  }
  else {
    $item = array('data' => $message, 'class' => array('authorize-results__failure'));
  }
  return $item;
}

Since a string is still being passed into the data item, rather than an array as the patch above does.

alimac’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
795 bytes

I re-rolled the patch (per instructions: https://www.drupal.org/patch/reroll) and verified that it applies cleanly to HEAD.

jhedstrom’s picture

Status: Needs review » Reviewed & tested by the community

This is still an issue, Element::children() still throws an error on this render array as it is returned now. The patch fixes the error.

YesCT’s picture

Issue summary: View changes
YesCT’s picture

Issue tags: -needs relevance check

the issue was verified to still be a problem in #11 and #13. removing the tag.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue addresses a major bug and is allowed per https://www.drupal.org/core/beta-changes. Committed 9792a0d and pushed to 8.0.x. Thanks!

  • alexpott committed 9792a0d on 8.0.x
    Issue #1885788 by alimac, tim.plunkett | jenlampton: Fixed An AJAX HTTP...

Status: Fixed » Closed (fixed)

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