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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Translation files missing in DOM since site move? Or ereg_replace error??


Go to End
Reply


4 Posts   1321 Views

Avatar
borriej

Community Member, 267 Posts

7 March 2011 at 9:20am

Edited: 09/03/2011 7:41am

Hello

I tranfered my site from hosting A to hosting B.
Downloaded all the files from A.. uploaded them to B.
Also tranfered the db..

dev/build as check..

Everything works, but it looks like some DOM translations are missing?
My website is set to dutch btw..

In de Event_calender module:
the 'add dates' button is now rendered as:
<% sprintf(_t('DataObjectManager.ADDITEM','Add %s',PR_MEDIUM,'Add [name]'),a Date) %>

Extended blog entry with Images via the DOM:
when empty:
<% sprintf(_t('DataObjectManager.NOITEMSFOUND','No %s found'),Fotos) %>

Any idea why this is?
On my previous hosting it was displayed correctly!

Avatar
borriej

Community Member, 267 Posts

9 March 2011 at 7:40am

I think there is a problem with my new hosting..

When i click on my page blog (in the CMS) i get this pop-up with the a large error

ERROR [Warning]: ereg_replace() [<a href='function.ereg-replace'>function.ereg-replace</a>]: Ongeldig bereikeinde
IN POST /admin/getitem?ID=6&ajax=1
Line 97 in /home/vhosts/url.nl/httpdocs/sapphire/widgets/Widget.php

Source
======
  88:  	}
  89:  	
  90:  	function CMSEditor() {
  91:  		$output = '';
  92:  		$fields = $this->getCMSFields();
  93:  		foreach($fields as $field) {
  94:  			$name = $field->Name();
  95:  			$field->setValue($this->getField($name));
  96:  			$renderedField = $field->FieldHolder();
* 97:  			$renderedField = ereg_replace("name=\"([A-Za-z0-9\-_]+)\"", "name=\"Widget[" . $this->ID .
       "][\\1]\"", $renderedField);
  98:  			$renderedField = ereg_replace("id=\"([A-Za-z0-9\-_]+)\"", "id=\"Widget[" . $this->ID .
       "][\\1]\"", $renderedField);
  99:  			$output .= $renderedField;
  100: 		}
  101: 		return $output;
  102: 	}
  103: 	

Trace
=====
<ul>ereg_replace(name="([A-Za-z0-9\-_]+)",name="Widget[3][\1]",<div id="DisplayMode" class="field optionset "><label class="left" for="DisplayMode">Tonen door</label><div class="middleColumn"><ul id="DisplayMode" class="optionset ">
<li class="odd valmonth"><input id="DisplayMode_month" name="DisplayMode" type="radio" value="month" checked="checked"  class="radio" /> <label for="DisplayMode_month">maand</label></li>
<li class="even valyear"><input id="DisplayMode_year" name="DisplayMode" type="radio" value="year"  class="radio" /> <label for="DisplayMode_year">jaar</label></li>
</ul>
</div></div>)
line 97 of Widget.php

Widget->CMSEditor()
line 369 of ViewableData.php

ViewableData->obj(CMSEditor,,,1)
line 446 of ViewableData.php

ViewableData->XML_val(CMSEditor,,1)
line 27 of .cache.cms.templates.WidgetEditor.ss

include(/home/vhosts/url.nl/httpdocs/silverstripe-cache/.cache.cms.templates.WidgetEditor.ss)
line 420 of SSViewer.php

SSViewer->process(ArchiveWidget)
line 342 of ViewableData.php

ViewableData->renderWith(WidgetEditor)
line 87 of Widget.php

Widget->EditableSegment()
line 369 of ViewableData.php

ViewableData->obj(EditableSegment,,,1)
line 446 of ViewableData.php

ViewableData->XML_val(EditableSegment,,1)
line 125 of .cache.cms.templates.WidgetAreaEditor.ss

include(/home/vhosts/url.nl/httpdocs/silverstripe-cache/.cache.cms.templates.WidgetAreaEditor.ss)
line 420 of SSViewer.php

SSViewer->process(WidgetAreaEditor)
line 342 of ViewableData.php

ViewableData->renderWith(WidgetAreaEditor)
line 26 of WidgetAreaEditor.php

WidgetAreaEditor->FieldHolder()
line 369 of ViewableData.php

ViewableData->obj(FieldHolder,,,1)
line 446 of ViewableData.php

ViewableData->XML_val(FieldHolder,,1)
line 73 of .cache.sapphire.templates.TabSetFieldHolder.ss

include(/home/vhosts/url.nl/httpdocs/silverstripe-cache/.cache.sapphire.templates.TabSetFieldHolder.ss)
line 420 of SSViewer.php

SSViewer->process(TabSet)
line 342 of ViewableData.php

ViewableData->renderWith(TabSetFieldHolder)
line 80 of TabSet.php

TabSet->FieldHolder()
line 369 of ViewableData.php

ViewableData->obj(FieldHolder,,,1)
line 446 of ViewableData.php

ViewableData->XML_val(FieldHolder,,1)
line 58 of .cache.sapphire.templates.TabSetFieldHolder.ss

include(/home/vhosts/url.nl/httpdocs/silverstripe-cache/.cache.sapphire.templates.TabSetFieldHolder.ss)
line 420 of SSViewer.php

SSViewer->process(TabSet)
line 342 of ViewableData.php

ViewableData->renderWith(TabSetFieldHolder)
line 80 of TabSet.php

TabSet->FieldHolder()
line 369 of ViewableData.php

ViewableData->obj(FieldHolder,,,1)
line 446 of ViewableData.php

ViewableData->XML_val(FieldHolder,,1)
line 77 of .cache.sapphire.templates.Includes.Form.ss

include(/home/vhosts/url.nl/httpdocs/silverstripe-cache/.cache.sapphire.templates.Includes.Form.ss)
line 420 of SSViewer.php

SSViewer->process(Form)
line 342 of ViewableData.php

ViewableData->renderWith(Array)
line 1108 of Form.php

Form->forTemplate()
line 1135 of Form.php

Form->formHtmlContent()
line 391 of LeftAndMain.php

LeftAndMain->getitem(SS_HTTPRequest)
line 193 of Controller.php

Controller->handleAction(SS_HTTPRequest)
line 143 of RequestHandler.php

RequestHandler->handleRequest(SS_HTTPRequest)
line 147 of Controller.php

Controller->handleRequest(SS_HTTPRequest)
line 282 of Director.php

Director::handleRequest(SS_HTTPRequest,Session)
line 125 of Director.php

Director::direct(/admin/getitem)
line 127 of main.php

</ul>

Any idea what is causing this problem??

Avatar
borriej

Community Member, 267 Posts

9 March 2011 at 10:37am

Ok its starting to get complicated...

when i change saphire/widgets/widget.php

line 97 to:

			$renderedField = str_replace("name=\"([A-Za-z0-9\-_]+)\"", "name=\"Widget[" . $this->ID . "][\\1]\"", $renderedField);
			$renderedField = str_replace("id=\"([A-Za-z0-9\-_]+)\"", "id=\"Widget[" . $this->ID . "][\\1]\"", $renderedField);

it show no errors anymore..

but when i try to add a link to a new featuredVideo widget in a new blog entry.. and presss save it doesn;t save the link!
When i check the page on the front-end it says:

[Notice] Undefined variable: width

Source

60 			break;
61 		default:
62 			$videoUrl = "";
63 		}
64 				
65 		$output = new DataObjectSet();
66 
67 		$output->push(new ArrayData(array(
68 					"Url" =>  $videoUrl,
69 					"Width" => $width,
70 					"Height" => $height,
71 					"YouTubeCode" => $videoID,
72 		)));
73 		
74 		return $output;

but its not undefined..

something is going wrong big time.

Please i need your support, else i need to move my hosting..

Avatar
sheadawson

Community Member, 49 Posts

9 August 2011 at 10:03pm

Did you ever find the problem? I'm having similar issues! Thanks