Commit a3af546f authored by Dries's avatar Dries

- Patch #831732 by solotandem: system_update_7053 needs to check for existence...

- Patch #831732 by solotandem: system_update_7053 needs to check for existence of menu_custom() table.
parent c28bba82
......@@ -1430,10 +1430,10 @@ protected function curlExec($curl_options, $redirect = FALSE) {
'!method' => !empty($curl_options[CURLOPT_NOBODY]) ? 'HEAD' : (empty($curl_options[CURLOPT_POSTFIELDS]) ? 'GET' : 'POST'),
'@url' => isset($original_url) ? $original_url : $url,
'@status' => $status,
'!length' => format_size(strlen($this->content))
'!length' => format_size(strlen($this->drupalGetContent()))
);
$message = t('!method @url returned @status (!length).', $message_vars);
$this->assertTrue($this->content !== FALSE, $message, t('Browser'));
$this->assertTrue($this->drupalGetContent() !== FALSE, $message, t('Browser'));
return $this->drupalGetContent();
}
......@@ -1498,7 +1498,7 @@ protected function parse() {
if (!$this->elements) {
// DOM can load HTML soup. But, HTML soup can throw warnings, suppress
// them.
@$htmlDom = DOMDocument::loadHTML($this->content);
@$htmlDom = DOMDocument::loadHTML($this->drupalGetContent());
if ($htmlDom) {
$this->pass(t('Valid HTML found on "@path"', array('@path' => $this->getUrl())), t('Browser'));
// It's much easier to work with simplexml than DOM, luckily enough
......@@ -1731,7 +1731,7 @@ protected function drupalPostAJAX($path, $edit, $triggering_element, $ajax_path
if (isset($path)) {
$this->drupalGet($path, $options);
}
$content = $this->content;
$content = $this->drupalGetContent();
$return = drupal_json_decode($this->drupalPost(NULL, $edit, array('path' => $ajax_path, 'triggering_element' => $triggering_element), $options, $headers, $form_html_id));
// We need $ajax_settings['wrapper'] to perform DOM manipulation.
......@@ -2376,7 +2376,7 @@ protected function assertRaw($raw, $message = '', $group = 'Other') {
if (!$message) {
$message = t('Raw "@raw" found', array('@raw' => $raw));
}
return $this->assert(strpos($this->content, $raw) !== FALSE, $message, $group);
return $this->assert(strpos($this->drupalGetContent(), $raw) !== FALSE, $message, $group);
}
/**
......@@ -2396,7 +2396,7 @@ protected function assertNoRaw($raw, $message = '', $group = 'Other') {
if (!$message) {
$message = t('Raw "@raw" not found', array('@raw' => $raw));
}
return $this->assert(strpos($this->content, $raw) === FALSE, $message, $group);
return $this->assert(strpos($this->drupalGetContent(), $raw) === FALSE, $message, $group);
}
/**
......@@ -2453,7 +2453,7 @@ protected function assertNoText($text, $message = '', $group = 'Other') {
*/
protected function assertTextHelper($text, $message = '', $group, $not_exists) {
if ($this->plainTextContent === FALSE) {
$this->plainTextContent = filter_xss($this->content, array());
$this->plainTextContent = filter_xss($this->drupalGetContent(), array());
}
if (!$message) {
$message = !$not_exists ? t('"@text" found', array('@text' => $text)) : t('"@text" not found', array('@text' => $text));
......@@ -2519,7 +2519,7 @@ protected function assertNoUniqueText($text, $message = '', $group = 'Other') {
*/
protected function assertUniqueTextHelper($text, $message = '', $group, $be_unique) {
if ($this->plainTextContent === FALSE) {
$this->plainTextContent = filter_xss($this->content, array());
$this->plainTextContent = filter_xss($this->drupalGetContent(), array());
}
if (!$message) {
$message = '"' . $text . '"' . ($be_unique ? ' found only once' : ' found more than once');
......
......@@ -2384,14 +2384,16 @@ function system_update_7053() {
->execute();
}
// Create the same menus as in menu_install().
db_insert('menu_custom')
->fields(array('menu_name' => 'user-menu', 'title' => 'User Menu', 'description' => "The <em>User</em> menu contains links related to the user's account, as well as the 'Log out' link."))
->execute();
if (db_table_exists('menu_custom')) {
// Create the same menus as in menu_install().
db_insert('menu_custom')
->fields(array('menu_name' => 'user-menu', 'title' => 'User Menu', 'description' => "The <em>User</em> menu contains links related to the user's account, as well as the 'Log out' link."))
->execute();
db_insert('menu_custom')
->fields(array('menu_name' => 'management', 'title' => 'Management', 'description' => "The <em>Management</em> menu contains links for administrative tasks."))
->execute();
db_insert('menu_custom')
->fields(array('menu_name' => 'management', 'title' => 'Management', 'description' => "The <em>Management</em> menu contains links for administrative tasks."))
->execute();
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment