17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1259 Views |
-
Useless code in FieldEditor.php

11 June 2007 at 11:39am Last edited: 11 June 2007 11:39am
Hi,
this piece of code seems useless:--- FieldEditor.php.orig 2007-01-19 12:01:24.000000000 +1300
+++ FieldEditor.php 2007-06-11 11:35:20.000000000 +1200
@@ -114,16 +114,6 @@
}*/function addfield() {
- // get the last field in this form editor
- $parentID = $this->form->getRecord()->ID;
- $lastField = DataObject::get('EditableFormField', "`ParentID`='$parentID'", "`Sort` DESC", null, 1 );
-
- $nextSort = 1;
-
- // the new sort value is the value of the last sort + 1 if a field exists
- if( $lastField )
- $nextSort += $lastField->Sort;
-
$className = "Editable" . ucfirst($_REQUEST['Type']);
$name = $this->name;
if(is_subclass_of($className, "EditableFormField")) { -
Re: Useless code in FieldEditor.php

11 June 2007 at 1:24pm
maybe it's not useless, maybe there should be something like
$e->Sort = $nextSort;
later in the code
-
Re: Useless code in FieldEditor.php

15 June 2007 at 10:31am
I think you are right there. It looks like the line to update the sort of the new element is missing.
The default ordering would display the fields in the expected order.
| 1259 Views | ||
|
Page:
1
|
Go to Top |

