Skip to content

Commit a57c322

Browse files
author
Steven Surowiec
committed
Fixed bug introduced by readonly commit
1 parent c5c874b commit a57c322

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

mongodbadmin.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -720,17 +720,18 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
720720
</h2>
721721
<?php $document = findMongoDbDocument($_REQUEST['id'], $_REQUEST['db'], $_REQUEST['collection']); ?>
722722

723-
<input type="hidden" name="values[_id]" value="<?php echo $document['_id'] ?>" />
724-
<?php foreach ($_REQUEST as $k => $v): ?>
725-
<input type="hidden" name="<?php echo $k ?>" value="<?php echo $v ?>" />
726-
<?php endforeach; ?>
727-
728723
<pre><code><?php echo renderDocumentPreview($mongo, $document) ?></code></pre>
729724

730725
<?php $prepared = prepareMongoDBDocumentForEdit($document) ?>
731726

732727
<?php if ($readOnly !== true): ?>
733728
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
729+
<input type="hidden" name="values[_id]" value="<?php echo $document['_id'] ?>" />
730+
731+
<?php foreach ($_REQUEST as $k => $v): ?>
732+
<input type="hidden" name="<?php echo $k ?>" value="<?php echo $v ?>" />
733+
<?php endforeach; ?>
734+
734735
<h2>Edit Document</h2>
735736
<input type="submit" name="save" value="Save" class="save_button" />
736737
<textarea name="value"><?php echo var_export($prepared, true) ?></textarea>

0 commit comments

Comments
 (0)