Permalink
Browse files

Reserved word warning config

This commit removes reserved word warning from the Browse pages and the
warning on structure page can be switched on/off using the config
variable $cfg['ReservedWordWarning']
  • Loading branch information...
ayushchd committed Mar 10, 2013
1 parent 2194bfc commit 665ffd4b4ce9a9b1a79cd9f6b87395e5ce6a491e
Showing with 18 additions and 23 deletions.
  1. +7 −0 libraries/config.default.php
  2. +0 −14 sql.php
  3. +11 −9 tbl_structure.php
@@ -69,6 +69,13 @@
*/
$cfg['ServerLibraryDifference_DisableWarning'] = false;
+/**

This comment has been minimized.

Show comment
Hide comment
@lem9

lem9 Mar 11, 2013

When adding a new directive, you should document it. This is done in doc/config.rst and I suggest adding a short paragraph in the Generic settings section.

It would be interesting also to offer the user a chance to change the directive, via the user prefs module (the "More settings" link on home page). Can you take care of these two issues?

@lem9

lem9 Mar 11, 2013

When adding a new directive, you should document it. This is done in doc/config.rst and I suggest adding a short paragraph in the Generic settings section.

It would be interesting also to offer the user a chance to change the directive, via the user prefs module (the "More settings" link on home page). Can you take care of these two issues?

This comment has been minimized.

Show comment
Hide comment
@ayushchd

ayushchd Mar 12, 2013

Owner

Okay, I'll do that.

@ayushchd

ayushchd Mar 12, 2013

Owner

Okay, I'll do that.

+ * Show warning about MySQL reserved words in column names
+ *
+ * @global boolean $cfg['ReservedWordWarning']
+ */

This comment has been minimized.

Show comment
Hide comment
@lem9

lem9 Mar 11, 2013

It's not an easy choice to pick up a default value but I think the community would be best served by setting this to true.

@lem9

lem9 Mar 11, 2013

It's not an easy choice to pick up a default value but I think the community would be best served by setting this to true.

+$cfg['ReservedWordWarning'] = false;
+
/**
* Show warning about incomplete translations on certain threshold.
*
View
14 sql.php
@@ -1203,20 +1203,6 @@
echo '</fieldset>' . "\n";
}
-
- // Check column names for MySQL reserved words
- $pma_table = new PMA_Table($table, $db);
- $columns = $pma_table->getReservedColumnNames();
- if (! empty($columns)) {
- foreach ($columns as $column) {
- $msg = PMA_message::notice(
- __('The column name \'%s\' is a MySQL reserved keyword.')
- );
- $msg->addParam($column);
- $msg->display();
- }
- }
-
// Displays the results in a table
if (empty($disp_mode)) {
// see the "PMA_setDisplayMode()" function in
View
@@ -134,15 +134,17 @@
$url_params['back'] = 'tbl_structure.php';
// Check column names for MySQL reserved words
-$pma_table = new PMA_Table($table, $db);
-$columns = $pma_table->getReservedColumnNames();
-if (! empty($columns)) {
- foreach ($columns as $column) {
- $msg = PMA_message::notice(
- __('The column name \'%s\' is a MySQL reserved keyword.')
- );
- $msg->addParam($column);
- $response->addHTML($msg);
+if ($cfg['ReservedWordWarning'] === true) {
+ $pma_table = new PMA_Table($table, $db);
+ $columns = $pma_table->getReservedColumnNames();
+ if (! empty($columns)) {
+ foreach ($columns as $column) {
+ $msg = PMA_message::notice(
+ __('The column name \'%s\' is a MySQL reserved keyword.')
+ );
+ $msg->addParam($column);
+ $response->addHTML($msg);
+ }
}
}

0 comments on commit 665ffd4

Please sign in to comment.