niedziela, 28 listopada 2010

Symfony form modification problem

After Symfony form customization you'll probably get an error like this:

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in lib/vendor/symfony/lib/util/sfParameterHolder.class.php on line 53

the fix is to specify widget's name format

$this->widgetSchema->setNameFormat("XYZ[%s]");

So you'll get something like

class AgendaUserForm extends BaseAgendaUserForm
{
public function configure(){

$this->setWidgets(array(
'email' => new sfWidgetFormInput(),
'pass' => new sfWidgetFormInputPassword()
));

$this->setValidators(array(
'email' => new sfValidatorEmail(),
'pass' => new sfValidatorString(array('max_length' => 255)),
'id' => new sfValidatorPass()
));

$this->widgetSchema->setNameFormat("ABC[%s]");
}
}

poniedziałek, 15 listopada 2010

Googlecl authentication error

If you get an error like this:
> picasa list-albums
Traceback (most recent call last):
File "/usr/bin/google", line 445, in run_interactive
run_once(options, args)
File "/usr/bin/google", line 577, in run_once
task.run(client, options, args)
File "/usr/lib/pymodules/python2.6/googlecl/picasa/service.py", line 476, in _run_list_albums
force_photos=False)
File "/usr/lib/pymodules/python2.6/googlecl/picasa/service.py", line 96, in build_entry_list
album_entry = self.GetAlbum(user=user, titles=titles)
File "/usr/lib/pymodules/python2.6/googlecl/picasa/service.py", line 212, in get_album
return self.GetEntries(uri, titles)
File "/usr/lib/pymodules/python2.6/googlecl/base.py", line 206, in get_entries
feed = self.GetFeed(uri)
File "/usr/lib/pymodules/python2.6/gdata/photos/service.py", line 177, in GetFeed
return self.Get(uri, converter=gdata.photos.AnyFeedFromString)
File "/usr/lib/pymodules/python2.6/gdata/service.py", line 1063, in Get
headers=extra_headers)
File "/usr/lib/pymodules/python2.6/atom/__init__.py", line 92, in optional_warn_function
return f(*args, **kwargs)
File "/usr/lib/pymodules/python2.6/atom/service.py", line 185, in request
data=data, headers=all_headers)
File "/usr/lib/pymodules/python2.6/gdata/auth.py", line 865, in perform_request
if self.oauth_input_params.requestor_id:
AttributeError: 'OAuthInputParams' object has no attribute 'requestor_id'

the simplest fix is deleting googlecl configuration. For Ubuntu 10.10
rm -r ~/.config/googlecl/
will do the trick :-).

środa, 10 listopada 2010

Gnome-do opensearch plugins not found

To workaround this you have to manually copy the plugins from /user/lib/firefox-/searchplugins into /home//.mozilla/firefox//searchplugins/ or create a symlink.

http://do.davebsd.com/wiki/OpenSearch_Plugin

poniedziałek, 1 listopada 2010

Ubuntu update to 10.10 Maverick killed my fglrx

Due to library problems I finally decided to update my Ubuntu to Maverick (10.10). Everything about the update was running smooth untill I tried running Xorg. Seemed my fglrx was broken - no big deal .. but reinstalling fglrx didn't fix it. I've tried drivers from repository, latest fglrx from amd's site (ati-driver-installer-10-10-x86.x86_64.run). Nothing helped... as a act of desperation i've tried

sudo stop gdm
sudo apt-get purge fglrx*
sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-dri fglrx-modaliases
sudo dpkg-reconfigure xserver-xorg
sudo apt-get install --reinstall xserver-xorg-core
sudo rm /etc/X11/xorg.conf

and then managed to install fglrx using jockey (menu system, administration, hardware drivers) and finally it was ok.