Do not try to set comment and MIME transformation if field not named.
This commit is contained in:
@@ -47,6 +47,9 @@ $Source$
|
|||||||
libraries/common.lib.php, libraries/relation.lib.php: Use common code
|
libraries/common.lib.php, libraries/relation.lib.php: Use common code
|
||||||
for CREATE/ALTER TABLE, set comments on creating table, so that user can
|
for CREATE/ALTER TABLE, set comments on creating table, so that user can
|
||||||
see it in the query.
|
see it in the query.
|
||||||
|
* tbl_addfield.php, tbl_alter.php, tbl_create.php: Do not try to set
|
||||||
|
comment and MIME transformation if field not named.
|
||||||
|
|
||||||
|
|
||||||
2005-10-07 Marc Delisle <lem9@users.sourceforge.net>
|
2005-10-07 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* libraries/check_user_privileges.lib.php: bug #1313821, dbname containing a
|
* libraries/check_user_privileges.lib.php: bug #1313821, dbname containing a
|
||||||
|
@@ -166,14 +166,18 @@ if (isset($submit_num_fields)) {
|
|||||||
// garvin: Update comment table, if a comment was set.
|
// garvin: Update comment table, if a comment was set.
|
||||||
if (isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork'] && PMA_MYSQL_INT_VERSION < 40100) {
|
if (isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork'] && PMA_MYSQL_INT_VERSION < 40100) {
|
||||||
foreach ($field_comments AS $fieldindex => $fieldcomment) {
|
foreach ($field_comments AS $fieldindex => $fieldcomment) {
|
||||||
PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment, '', 'pmadb');
|
if (!empty($field_name[$fieldindex])) {
|
||||||
|
PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment, '', 'pmadb');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// garvin: Update comment table for mime types [MIME]
|
// garvin: Update comment table for mime types [MIME]
|
||||||
if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) {
|
if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) {
|
||||||
foreach ($field_mimetype AS $fieldindex => $mimetype) {
|
foreach ($field_mimetype AS $fieldindex => $mimetype) {
|
||||||
PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]);
|
if (!empty($field_name[$fieldindex])) {
|
||||||
|
PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -82,7 +82,9 @@ if (isset($do_save_data)) {
|
|||||||
// garvin: Update comment table, if a comment was set.
|
// garvin: Update comment table, if a comment was set.
|
||||||
if (PMA_MYSQL_INT_VERSION < 40100 && isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork']) {
|
if (PMA_MYSQL_INT_VERSION < 40100 && isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork']) {
|
||||||
foreach ($field_comments AS $fieldindex => $fieldcomment) {
|
foreach ($field_comments AS $fieldindex => $fieldcomment) {
|
||||||
PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment, $field_orig[$fieldindex], 'pmadb');
|
if (!empty($field_name[$fieldindex])) {
|
||||||
|
PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment, $field_orig[$fieldindex], 'pmadb');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +129,9 @@ if (isset($do_save_data)) {
|
|||||||
// garvin: Update comment table for mime types [MIME]
|
// garvin: Update comment table for mime types [MIME]
|
||||||
if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) {
|
if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) {
|
||||||
foreach ($field_mimetype AS $fieldindex => $mimetype) {
|
foreach ($field_mimetype AS $fieldindex => $mimetype) {
|
||||||
PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]);
|
if (!empty($field_name[$fieldindex])) {
|
||||||
|
PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -179,7 +179,6 @@ if (isset($submit_num_fields)) {
|
|||||||
// garvin: Update comment table, if a comment was set.
|
// garvin: Update comment table, if a comment was set.
|
||||||
if (isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork'] && PMA_MYSQL_INT_VERSION < 40100) {
|
if (isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork'] && PMA_MYSQL_INT_VERSION < 40100) {
|
||||||
foreach ($field_comments AS $fieldindex => $fieldcomment) {
|
foreach ($field_comments AS $fieldindex => $fieldcomment) {
|
||||||
// do not try to set a comment if the field name is empty
|
|
||||||
if (!empty($field_name[$fieldindex])) {
|
if (!empty($field_name[$fieldindex])) {
|
||||||
PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment, '', 'pmadb');
|
PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment, '', 'pmadb');
|
||||||
}
|
}
|
||||||
@@ -189,7 +188,9 @@ if (isset($submit_num_fields)) {
|
|||||||
// garvin: Update comment table for mime types [MIME]
|
// garvin: Update comment table for mime types [MIME]
|
||||||
if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) {
|
if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) {
|
||||||
foreach ($field_mimetype AS $fieldindex => $mimetype) {
|
foreach ($field_mimetype AS $fieldindex => $mimetype) {
|
||||||
PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]);
|
if (!empty($field_name[$fieldindex])) {
|
||||||
|
PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user