Skip to content

Commit 10d69ce

Browse files
committed
Disable 'branch' field except for new mapping
Since the branch's name is used as key to identify the mapping, it is not possible to change it. To avoid confusing behavior, the input field is disabled, except for the new mapping row. Fixes #243
1 parent c88f88c commit 10d69ce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Source/pages/repo_manage_page.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,11 @@ function convert_to_key_value( $p_array ) {
194194

195195
foreach( $t_mappings as $t_mapping ) {
196196
$t_branch = str_replace( '.', '_', $t_mapping->branch );
197+
# Since it is not possible to update the branch's name (see #230),
198+
# the input field is disabled, except for the 'new mapping' row
199+
$t_disabled = 'disabled';
197200
if( is_null( $t_mapping->branch ) ) {
201+
$t_disabled = '';
198202
?>
199203
<tr class="spacer"></tr><tr></tr>
200204
<?php
@@ -204,7 +208,9 @@ function convert_to_key_value( $p_array ) {
204208
<td class="center">
205209
<input type="text" name="<?php echo $t_branch ?>_branch" value="<?php
206210
echo string_attribute( $t_mapping->branch )
207-
?>" class="input-sm" />
211+
?>" class="input-sm"
212+
<?php echo $t_disabled; ?>
213+
/>
208214
</td>
209215
<td class="center">
210216
<select class="input-sm" name="<?php echo $t_branch ?>_type"><?php

0 commit comments

Comments
 (0)