-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inconsistent calls #47
base: 6.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,7 +100,7 @@ function drupal_test_pgsql($url, &$success) { | |
// Test UNLOCK, which is done automatically upon transaction end in PostgreSQL | ||
$query = 'COMMIT'; | ||
$result = pg_query($connection, $query); | ||
if ($error = pg_result_error()) { | ||
if ($error = pg_result_error($result)) { | ||
drupal_set_message(st('Failed to unlock a test table on your PostgreSQL database server. We tried unlocking a table with the command %query and PostgreSQL reported the following error: %error.', array('%query' => $query, '%error' => $error)), 'error'); | ||
$err = TRUE; | ||
} | ||
|
@@ -111,7 +111,7 @@ function drupal_test_pgsql($url, &$success) { | |
// Test DELETE. | ||
$query = 'DELETE FROM drupal_install_test'; | ||
$result = pg_query($connection, $query); | ||
if ($error = pg_result_error()) { | ||
if ($error = pg_result_error($result)) { | ||
drupal_set_message(st('Failed to delete a value from a test table on your PostgreSQL database server. We tried deleting a value with the command %query and PostgreSQL reported the following error: %error.', array('%query' => $query, '%error' => $error)), 'error'); | ||
$err = TRUE; | ||
} | ||
|
@@ -122,7 +122,7 @@ function drupal_test_pgsql($url, &$success) { | |
// Test DROP. | ||
$query = 'DROP TABLE drupal_install_test'; | ||
$result = pg_query($connection, $query); | ||
if ($error = pg_result_error()) { | ||
if ($error = pg_result_error($result)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you. I'll be using that. |
||
drupal_set_message(st('Failed to drop a test table from your PostgreSQL database server. We tried dropping a table with the command %query and PostgreSQL reported the following error %error.', array('%query' => $query, '%error' => $error)), 'error'); | ||
$err = TRUE; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ function menu_overview_form(&$form_state, $menu) { | |
menu_tree_check_access($tree, $node_links); | ||
$menu_admin = FALSE; | ||
|
||
$form = _menu_overview_tree_form($tree); | ||
$form = _menu_overview_tree_form($tree, $form_state); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting... If your goal is for the code to be less misleading, I'd advocate for the reverse change instead: remove $form_state completely from _menu_overview_tree_form(). This is only called on first form build when $form_state is empty, and on form rebuild / early submit, when $form_state[MLID] is never filled, so it doesn't do anything. (Only $form_state['post'] is ever filled). (Unless some custom code wants to call As a bonus, that also makes sure there's no behavior change. (Not that I think it's necessary per se - I have no strong opinion on dead D6 code that doesn't do anything.) |
||
$form['#menu'] = $menu; | ||
if (element_children($form)) { | ||
$form['submit'] = array( | ||
|
@@ -59,7 +59,7 @@ function menu_overview_form(&$form_state, $menu) { | |
/** | ||
* Recursive helper function for menu_overview_form(). | ||
*/ | ||
function _menu_overview_tree_form($tree) { | ||
function _menu_overview_tree_form($tree, $form_state) { | ||
static $form = array('#tree' => TRUE); | ||
foreach ($tree as $data) { | ||
$title = ''; | ||
|
@@ -111,7 +111,7 @@ function _menu_overview_tree_form($tree) { | |
} | ||
|
||
if ($data['below']) { | ||
_menu_overview_tree_form($data['below']); | ||
_menu_overview_tree_form($data['below'], $form_state); | ||
} | ||
} | ||
return $form; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
<?php print phptemplate_get_ie_styles(); ?> | ||
<![endif]--> | ||
</head> | ||
<body<?php print phptemplate_body_class($left, $right); ?>> | ||
<body<?php phptemplate_body_class($left, $right); ?>> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmhmhm. This is unfortunate. Indeed the print statement does not do anything, because phptemplate_body_class() as the only function in template.php has its own print statement. (I'm guessing that was a bug / oversight.) So I can understand it messes with your static code analysis or IDE. But wouldn't removing the print statement from here, cause more confusion for human code/template readers, who don't know that phptemplate_body_class() is quasi-buggy? |
||
|
||
<!-- Layout --> | ||
<div id="header-region" class="clear-block"><?php print $header; ?></div> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blegh. Yes this change is good.
This wonky code is also still present in D7, and this line once cost me a few hours because I was assuming _batch_process() was actually using $batch. Which it isn't.