An AJAX HTTP error occurred. HTTP Result Code: 200

I am using a views megarow display to display recurring payment entities using the recurring framework.

On saving a recurring entity from a megarow edit form, the data is saved, but an AJAX error pops up before the row can close or the page can refresh.

In another issue queue it has been mentioned that this is because there is some hard coded default behaviour on certain types of entities. Could you provide some documentation on how to implement this please?

CommentFileSizeAuthor
screen.jpg218.85 KBCollins405
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Collins405 created an issue. See original summary.

Collins405’s picture

Issue summary: View changes
omidehghanZD’s picture

I have the same problem....is any way for this issue?

Collins405’s picture

@omidehghanZD Sorry, its been so long I dont remember. I think i used a different display for this instead of Megarow.

Collins405’s picture

....and im back here again.

I have a link to edit an entityform submission inside a megarow.

When i click save, the content is saved, but the ajax error occurs. Annoyinly no errors are showing in watchdog so im not 100% sure where to start looking.

Can we have some help on this one?

Collins405’s picture

OK, so i created my own module and used the following code to get the result i wanted.

/**
 * Implements hook_drupal_goto_alter()
 */
function YOURMODULE_drupal_goto_alter(&$path, &$options, &$http_response_code) {	
	// If this is a request to the views_megarow callback that is being redirected, rewrite the redirect
	if (substr($_GET['q'], 0, 15) === 'display_megarow') {		
		$page_path = explode('/', $_GET['q']);
		$path = $page_path[0] . '/' . $page_path[1] . '/entityform/' . $page_path[1] . '/edit';
	}
}

This will reload the entityform edit page. If $page_path[1] is the entity id, you should be able to change this path to suit your need.

It also displays the success message inside if you use the patch here...

diff --git a/views_megarow.module b/views_megarow.module
index 95f53a2..a16680e 100755
--- a/views_megarow.module
+++ b/views_megarow.module
@@ -105,8 +105,9 @@ function views_megarow_generic_render($entity_id) {
     if (isset($output['#type']) && $output['#type'] == 'ajax') {
       return $output;
     }
-    $arguments = array('display' => 'error');
-    $messages = theme('status_messages', $arguments);
+
+    // We want to show all message types here.
+    $messages = theme('status_messages');
 
     // Pass the result of this to the modal to display it.
     $content = array(
Collins405’s picture

Status: Active » Needs review
NWOM’s picture

Version: 7.x-1.5 » 7.x-1.x-dev
Status: Needs review » Needs work

Setting to Needs Work, since no patch is attached to review.