brustj / tracmor

Automatically exported from code.google.com/p/tracmor
GNU General Public License v2.0
0 stars 0 forks source link

Asset Code auto-generate is broken #55

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Set a minimum asset code in Admin->System Settings
2. Create a new asset,  checking the Auto-Generate checkbox.
3. Create another asset,  checking the Auto-Generate checkbox.

What is the expected output? What do you see instead?
The asset should be saved with an asset code generated.  Instead you get an
AJAX error:

MySqli Error: Column 'entity_id' cannot be null
Exception Type:   QMySqliDatabaseException

Rendered Page:   Click here to view contents able to be rendered

Source File:   /var/www/tracmor/includes/data_classes/CustomField.class.php
    Line:   494

Line 489:                       
$objCustomFieldArray[$i]->CustomFieldSelection->newCustomFieldValue->ShortDescri
ption
= $arrCustomFields[$i]['input']->Text;
Line 490:                       
$objCustomFieldArray[$i]->CustomFieldSelection->newCustomFieldValue->Save();
Line 491:                           $objCustomFieldArray[$i]->CustomFieldSelection->EntityId
= $intEntityId;
Line 492:                       
$objCustomFieldArray[$i]->CustomFieldSelection->EntityQtypeId =
$intEntityQtypeId;
Line 493:                       
$objCustomFieldArray[$i]->CustomFieldSelection->CustomFieldValueId =
$objCustomFieldArray[$i]->CustomFieldSelection->newCustomFieldValue->CustomField
ValueId;
Line 494:                       
$objCustomFieldArray[$i]->CustomFieldSelection->Save();                         
Line 495:                       }
Line 496:                       else {
Line 497:                       
$objCustomFieldArray[$i]->CustomFieldSelection->CustomFieldValue->ShortDescripti
on
= $arrCustomFields[$i]['input']->Text;
Line 498:                       
$objCustomFieldArray[$i]->CustomFieldSelection->CustomFieldValue->Save();
Line 499:                       }

Database Error Number:  1048

Call Stack:

#0
/var/www/tracmor/includes/data_classes/generated/CustomFieldSelectionGen.class.p
hp(510):
QMySqliDatabase->NonQuery('???????INSERT I...')
#1 /var/www/tracmor/includes/data_classes/CustomField.class.php(494):
CustomFieldSelectionGen->Save()
#2
/var/www/tracmor/includes/qcodo/qform/QAssetEditComposite.class.php(746):
CustomField::SaveControls(Array, false, Array, NULL, 1)
#3 /var/www/tracmor/includes/qcodo/_core/qform/QFormBase.class.php(655):
QAssetEditComposite->btnSave_Click('AssetEditForm', 'c42', '')
#4 /var/www/tracmor/includes/qcodo/_core/qform/QFormBase.class.php(774):
QFormBase->TriggerMethod('c42', 'c6:btnSave_Clic...')
#5 /var/www/tracmor/includes/qcodo/_core/qform/QFormBase.class.php(242):
QFormBase->TriggerActions()
#6 /var/www/tracmor/assets/asset_edit.php(292):
QFormBase::Run('AssetEditForm', 'asset_edit.tpl....')
#7 {main}

Original issue reported on code.google.com by jsincl...@gmail.com on 31 Jul 2008 at 10:31

GoogleCodeExporter commented 8 years ago

Original comment by jsincl...@gmail.com on 16 Apr 2009 at 11:09

GoogleCodeExporter commented 8 years ago
This is fixed in r510.

Original comment by jsincl...@gmail.com on 17 Apr 2009 at 4:01