Jump to content
X2Community Forums

Recommended Posts

When I try to create a new role in X2CRM I get the following error log.


Error Code: 500
Error Message: preg_match(): Compilation failed: regular expression is too large at offset 36482
Stack Trace: [click to toggle display]

PHP warning in /var/www/html/X2CRM-master/x2engine/framework/validators/CRegularExpressionValidator.php(55)
#0 /var/www/html/X2CRM-master/x2engine/framework/validators/CRegularExpressionValidator.php(55): preg_match()
#1 /var/www/html/X2CRM-master/x2engine/framework/validators/CValidator.php(201): CRegularExpressionValidator->validateAttribute()
#2 /var/www/html/X2CRM-master/x2engine/framework/base/CModel.php(159): CRegularExpressionValidator->validate()
#3 /var/www/html/X2CRM-master/x2engine/framework/db/ar/CActiveRecord.php(808): Roles->validate()
#4 /var/www/html/X2CRM-master/x2engine/protected/controllers/AdminController.php(2381): Roles->save()
#5 /var/www/html/X2CRM-master/x2engine/framework/web/actions/CInlineAction.php(49): AdminController->actionManageRoles()
#6 /var/www/html/X2CRM-master/x2engine/framework/web/CController.php(308): CInlineAction->runWithParams()
#7 /var/www/html/X2CRM-master/x2engine/framework/web/filters/CFilterChain.php(133): AdminController->runAction()
#8 /var/www/html/X2CRM-master/x2engine/protected/controllers/AdminController.php(730): CFilterChain->run()
#9 /var/www/html/X2CRM-master/x2engine/framework/web/filters/CInlineFilter.php(58): AdminController->filterClearCache()
#10 /var/www/html/X2CRM-master/x2engine/framework/web/filters/CFilterChain.php(130): CInlineFilter->filter()
#11 /var/www/html/X2CRM-master/x2engine/framework/web/CController.php(291): CFilterChain->run()
#12 /var/www/html/X2CRM-master/x2engine/framework/web/CController.php(265): AdminController->runActionWithFilters()
#13 /var/www/html/X2CRM-master/x2engine/framework/web/CWebApplication.php(282): AdminController->run()
#14 /var/www/html/X2CRM-master/x2engine/framework/web/CWebApplication.php(141): X2WebApplication->runController()
#15 /var/www/html/X2CRM-master/x2engine/framework/base/CApplication.php(185): X2WebApplication->processRequest()
#16 /var/www/html/X2CRM-master/x2engine/index.php(64): X2WebApplication->run()

X2Engine Version: 6.9.3
PHP Version: 5.4.16


Any work around to get this working?

the only thing I can find online is to recompile PHP.

Link to post
Share on other sites

I found that commenting out the if statement in framework/validators/CRegularExpressionValidator.php and changing it to "if(false)" allows the role to be completed but with a limited number of fields.

As a work around, now I should be able to figure out a mysql script to manually edit the various roles tables.

We have about 1200 fields that its trying to set permissions for. It seems the interface could be modified to set each modules fields separately rather than all at once. This way X2 won't crash for larger implementations.

Hopefully in the future there is a better interface to manage roles.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...