Jump to content


Photo

Error while trying to save an account


  • Please log in to reply
10 replies to this topic

#1 Keyoung

Keyoung

    Member

  • Members
  • PipPip
  • 21 posts

Posted 30 October 2018 - 09:55 PM

I encountered below error while trying to save a newly created 'Account':

 

Error Code: 500
Error Message: CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1364 Field 'modelName' doesn't have a default value
Stack Trace: [click to toggle display]
X2Engine Version: 7.0
PHP Version: 7.0.32-3+ubuntu18.04.1+deb.sury.org+1

 

Please check and advise.



#2 X2Peter

X2Peter

    Advanced Member

  • Administrators
  • 57 posts

Posted 31 October 2018 - 12:43 PM

Hello Keyoung,

 

Could you send me the full stack trace of this error (this can be done by clicking the 'click to toggle display' link)?



#3 Keyoung

Keyoung

    Member

  • Members
  • PipPip
  • 21 posts

Posted 31 October 2018 - 11:32 PM

Here it is:

Error Code: 500
Error Message: CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1364 Field 'modelName' doesn't have a default value
Stack Trace: [click to toggle display]

CDbException in /var/www/html/x2crm/framework/db/CDbCommand.php(358)
#0 /var/www/html/x2crm/framework/db/ar/CActiveRecord.php(1083): CDbCommand->execute()
#1 /var/www/html/x2crm/protected/models/X2Model.php(1607): CActiveRecord->insert(NULL)
#2 /var/www/html/x2crm/protected/models/X2Model.php(901): X2Model->insert(NULL)
#3 /var/www/html/x2crm/protected/modules/accounts/controllers/AccountsController.php(218): X2Model->save()
#4 /var/www/html/x2crm/framework/web/actions/CInlineAction.php(49): AccountsController->actionCreate()
#5 /var/www/html/x2crm/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#6 /var/www/html/x2crm/framework/web/filters/CFilterChain.php(133): CController->runAction(Object(CInlineAction))
#7 /var/www/html/x2crm/protected/controllers/x2base.php(579): CFilterChain->run()
#8 /var/www/html/x2crm/framework/web/filters/CInlineFilter.php(58): x2base->filterSetPortlets(Object(CFilterChain))
#9 /var/www/html/x2crm/framework/web/filters/CFilterChain.php(130): CInlineFilter->filter(Object(CFilterChain))
#10 /var/www/html/x2crm/framework/web/filters/CFilter.php(40): CFilterChain->run()
#11 /var/www/html/x2crm/framework/web/filters/CFilterChain.php(130): CFilter->filter(Object(CFilterChain))
#12 /var/www/html/x2crm/framework/web/filters/CFilter.php(40): CFilterChain->run()
#13 /var/www/html/x2crm/framework/web/filters/CFilterChain.php(130): CFilter->filter(Object(CFilterChain))
#14 /var/www/html/x2crm/framework/web/CController.php(291): CFilterChain->run()
#15 /var/www/html/x2crm/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#16 /var/www/html/x2crm/framework/web/CWebApplication.php(282): CController->run('create')
#17 /var/www/html/x2crm/protected/components/X2WebApplication.php(63): CWebApplication->runController('accounts/accoun...')
#18 /var/www/html/x2crm/framework/base/CApplication.php(185): X2WebApplication->processRequest()
#19 /var/www/html/x2crm/index.php(65): CApplication->run()
#20 {main}

X2Engine Version: 7.0
PHP Version: 7.0.32-3+ubuntu18.04.1+deb.sury.org+1



#4 Keyoung

Keyoung

    Member

  • Members
  • PipPip
  • 21 posts

Posted 04 November 2018 - 07:35 PM

Any hints or update?

This error occurs whenever I try to create an account and then save.



#5 page1

page1

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 07 November 2018 - 04:14 AM

I am having this same exact issue... PLEASE HELP



#6 Keyoung

Keyoung

    Member

  • Members
  • PipPip
  • 21 posts

Posted 07 November 2018 - 09:47 PM

Yes, this is annoying as it is the basic function of the system. Now I cannot create NEW account!!!

Pls help urgently!!!



#7 MistaJohn

MistaJohn

    Member

  • Premium Members
  • PipPip
  • 15 posts

Posted 08 November 2018 - 09:26 AM

A quick fix is to add the Model Name field in the Account form - add to the bottom of the form, field does not have to be populated for an Account to be created.



#8 page1

page1

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 08 November 2018 - 12:22 PM

EXCELLENT THAT WORKED!!

THANK YOU!!! I'm back in business.



#9 X2Peter

X2Peter

    Advanced Member

  • Administrators
  • 57 posts

Posted 08 November 2018 - 04:13 PM

This is strange, I am having trouble replicating this issue on a fresh installation of 7.0. Is this happening with any other modules?



#10 page1

page1

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 08 November 2018 - 05:18 PM

I am assuming this is happening on older versions that upgrade to 7.0. I have recently upgraded and ran into this issue. It's been a while since my upgrade, but I don't think I have tried to create a new record since the upgrade took place.



#11 Keyoung

Keyoung

    Member

  • Members
  • PipPip
  • 21 posts

Posted 08 November 2018 - 06:12 PM

I already have 'modelName' field in x2_accounts. What I did is to change the 'Default Value' from 'NULL' to 'Empty String' and it works!

 

Problem solved!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users