ImageMedia seems to be deleted when I save it.

Hi everybody,

I have a form displaying an ImageMedia which can be changed and saved. The media itself is read from the database at the start of the application and placed into a global variable. This global is the dataprovider of the ImageMedia field.
When I try to change the picture (action “load media”) it displays correctly the new one. But when I click on the button to save it, the field becomes blank, as if the picture was deleted.
Here are the properties of the field:
[attachment=0]Capture.PNG[/attachment]

The global variable is of type MEDIA.
And here is the code run when you clikc on the Save button:

function RecordSettings() {
	if(forms.frm_settings.controller.find())
	{
		forms.frm_settings.fld_personnel_id = 0;
		forms.frm_settings.fld_setting = "comp_%";
		forms.frm_settings.controller.search();
	}
	
	for (var i = 1; i <= forms.frm_settings.controller.getMaxRecordIndex(); i++)
	{
		forms.frm_settings.controller.setSelectedIndex(i)
			if (utils.stringRight(forms.frm_settings.fld_setting,5) == "_pict")
			{
				forms.frm_settings.fld_picture = globals["g_setting_"+forms.frm_settings.fld_setting];
			}else{
				forms.frm_settings.fld_value = globals["g_setting_"+forms.frm_settings.fld_setting];
			}
	}
	databaseManager.saveData();
}

As you can see the global is not modified. I have checked “g_setting_”+forms.frm_settings.fld_setting, it is correct (generated string is the same as the global variable name).

Yes, seems to be the same problem as reported here: http://www.servoy.com/forum/viewtopic.php?f=22&t=15186&start=0&st=0&sk=t&sd=a.

Andrei Costescu:
Yes, seems to be the same problem as reported here: http://www.servoy.com/forum/viewtopic.php?f=22&t=15186&start=0&st=0&sk=t&sd=a.

Yes indeed. So do you think it is an issue within Servoy (if yes, when is planned the next release) or the way we have set it up? :roll:

From what I could tell it is a problem with Servoy. We hope to have this solved in 5.2.3 which is coming soon…

fixed in the upcoming 5.2 release

Great news!
Thx :)