]> git.joonet.de Git - adminer.git/commitdiff
Do not display error for foreign keys to other databases
authorJakub Vrana <jakub@vrana.cz>
Wed, 21 Aug 2019 12:19:48 +0000 (14:19 +0200)
committerJakub Vrana <jakub@vrana.cz>
Wed, 21 Aug 2019 12:19:48 +0000 (14:19 +0200)
adminer/foreign.inc.php

index c87728e660770f83de67129e9175e50e815d3d5f..811eb64bb44e38ef78ea4e99c251fa022fbca585 100644 (file)
@@ -48,17 +48,18 @@ if ($_POST) {
        $row["table"] = $TABLE;
        $row["source"] = array("");
 }
-
-$source = array_keys(fields($TABLE)); //! no text and blob
-$target = ($TABLE === $row["table"] ? $source : array_keys(fields($row["table"])));
-$referencable = array_keys(array_filter(table_status('', true), 'fk_support'));
 ?>
 
 <form action="" method="post">
 <p>
-<?php if ($row["db"] == "" && $row["ns"] == "") { ?>
-<?php echo lang('Target table'); ?>:
-<?php echo html_select("table", $referencable, $row["table"], "this.form['change-js'].value = '1'; this.form.submit();"); ?>
+<?php
+if ($row["db"] == "" && $row["ns"] == "") {
+       $source = array_keys(fields($TABLE)); //! no text and blob
+       $target = ($TABLE === $row["table"] ? $source : array_keys(fields($row["table"])));
+       $referencable = array_keys(array_filter(table_status('', true), 'fk_support'));
+       echo lang('Target table') . ": ";
+       echo html_select("table", $referencable, $row["table"], "this.form['change-js'].value = '1'; this.form.submit();");
+       ?>
 <input type="hidden" name="change-js" value="">
 <noscript><p><input type="submit" name="change" value="<?php echo lang('Change'); ?>"></noscript>
 <table cellspacing="0">