Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

userforms module completely broke my site - VERY CRITICAL PROBLEM


Go to End


2 Posts   2493 Views

Avatar
François

25 Posts

4 December 2008 at 6:20am

Edited: 04/12/2008 6:39am

I installed the userforms module in SS 2.3.0-rc1.

I followed instruction (hard to find by the way) in http://doc.silverstripe.com/doku.php?id=upgrading#user_defined_form

I had to install the trunk version of the module as the link to the 0.1 version doesn't work.

After having rebuild the db I created a page and assigned the "User defined form" page type to this new page.

When saving this page I got the message "Error saving...". Since that, I can not longer log in the CMS. I get the error reproduced at the end of this post.

I have completely lost access to the admin of my site!!! What can I do to retrieve it?

Even if I remove the userforms modules (only the files, not the db tables) I still get a fatal error when trying to access to cms.

I sincerely hope somebody can help me.

UPDATE:
I suspected a problem related to some i18n field (because i18n is really severely broken in SS) and I changed the Locale of my user (directly in the Member table) from "fr_FR" back to "en_US". And, voilà, I can access the CMS.

But my problem is not solved because my client doesn't speak english and want to work in french and/or german. What can I do or where can I look in the code to try to solve this problem?

[User Error] FieldSet::addFieldToTab() Tried to add a tab to object 'Tab' named 'Complétion en cours' - '' didn't exist.
GET /ss230/admin/?flush=1

Line 250 in /home/francois/workspace/labo_ss2.3.0-rc1/sapphire/forms/FieldSet.php
Source

241 					// use $title on the innermost tab only
242 					if($title && $k == count($parts)-1) {
243 						$currentPointer = new Tab($part, $title);
244 					} else {
245 						$currentPointer = new Tab($part);
246 					}
247 					$parentPointer->push($currentPointer);
248 				} else {
249 					$withName = ($parentPointer->hasMethod('Name')) ? " named '{$parentPointer->Name()}'" : null;
250 					user_error("FieldSet::addFieldToTab() Tried to add a tab to object '{$parentPointer->class}'{$withName} - '$part' didn't exist.", E_USER_ERROR);
251 				}
252 			}
253 		}
254 		
255 		return $currentPointer;
256 	}

Trace

    * FieldSet::addFieldToTab() Tried to add a tab to object 'Tab' named 'Complétion en cours' - '' didn't exist.
      Line 250 of FieldSet.php
    * FieldSet->findOrMakeTab(Root.Content.Complétion en cours...)
      Line 91 of FieldSet.php
    * FieldSet->addFieldToTab(Root.Content.Complétion en cours...,HtmlEditorField)
      Line 38 of UserDefinedForm.php
    * UserDefinedForm->getCMSFields(CMSMain)
      Line 375 of CMSMain.php
    * CMSMain->getEditForm(3)
      Line 740 of LeftAndMain.php
    * LeftAndMain->EditForm()
    * call_user_func_array(Array,Array)
      Line 551 of ViewableData.php
    * ViewableData->cachedCall(EditForm,,)
      Line 592 of ViewableData.php
    * ViewableData->hasValue(EditForm)
      Line 66 of .cache.home.francois.workspace34.labo_ss2.3.0-rc1.cms.templates.Includes.CMSMain_right.ss
    * include(/tmp/silverstripe-cache-var-www-ss230/.cache.home.francois.workspace34.labo_ss2.3.0-rc1.cms.templates.Includes.CMSMain_right.ss)
      Line 328 of SSViewer.php
    * SSViewer->process(CMSMain)
      Line 774 of ViewableData.php
    * ViewableData->renderWith(Array)
      Line 341 of LeftAndMain.php
    * LeftAndMain->Right()
    * call_user_func_array(Array,Array)
      Line 409 of ViewableData.php
    * ViewableData->XML_val(Right,,1)
      Line 114 of .cache.home.francois.workspace34.labo_ss2.3.0-rc1.cms.templates.LeftAndMain.ss
    * include(/tmp/silverstripe-cache-var-www-ss230/.cache.home.francois.workspace34.labo_ss2.3.0-rc1.cms.templates.LeftAndMain.ss)
      Line 328 of SSViewer.php
    * SSViewer->process(CMSMain)
      Line 177 of Controller.php
    * Controller->handleAction(HTTPRequest)
      Line 107 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
      Line 124 of Controller.php
    * Controller->handleRequest(HTTPRequest)
      Line 246 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
      Line 106 of Director.php
    * Director::direct(/admin/)
      Line 92 of main.php

Avatar
François

25 Posts

4 December 2008 at 6:59am

to solve, temporarily, the problem:

in userforms/lang/fr_FR.php

replace:

$lang['fr_FR']['UserDefinedForm']['ONCOMPLETE'] = 'Complétion en cours...';

with:

$lang['fr_FR']['UserDefinedForm']['ONCOMPLETE'] = 'On complete';

But I think the REAL problem lies in the following code:

userforms/code/UserDefinedForm.php :

$fields->addFieldToTab("Root.Content."._t('UserDefinedForm.ONCOMPLETE','On complete'), new HtmlEditorField( "OnCompleteMessage", _t('UserDefinedForm.ONCOMPLETELABEL', 'Show on completion'),3,"",_t('UserDefinedForm.ONCOMPLETEMESSAGE', $this->OnCompleteMessage), $this ) );