JoomFish / joomfish-2.5

Joom!Fish 2.5 core development
http://www.joomfish.net/
34 stars 27 forks source link

3rd party comp.: Class 'JFormFieldList' not found when translating its menu item #67

Closed quodo closed 12 years ago

quodo commented 12 years ago

I'm testing a third-party component RSGallery2 (http://joomlacode.org/gf/project/rsgallery2/frs/?action=FrsReleaseView&release_id=16416). Its Content Element files install fine (there are 2: http://joomlacode.org/gf/project/rsgallery2/frs/?action=FrsReleaseView&release_id=12881). I have created a menu item (Backend > Menus > [Choose a menu and add a new item] > Menu Item Type = View of galleries, with that menu item one can choose a gallery, it's one of the Required Settings ("parameters") of this menu type. I choose "Root gallery" from a dropdown list. The dropdownlist is custommade from a function getOptions in a class JFormFieldGallery that extends JFormFieldList (in administrator models/fields directory). (I couldn't find where I learned how to do that...)

When I try to translated the menu-item with Joomfish I get an error message Fatal error: Class 'JFormFieldList' not found in ...\administrator\components\com_rsgallery2\models\fields\gallery.php on line 20 This line is says class JFormFieldGallery extends JFormFieldList

JForm was new in Joomla 1.6, it is extended by JFormField which is extended by JFormFieldList: http://docs.joomla.org/JFormFieldList/11.1. Perhaps relevant as well: http://docs.joomla.org/Creating_a_custom_form_field_type

MStruller commented 12 years ago

I think this is an problem from RSGallery not from jf the gallery.php must load with jimport( 'joomla.form.fields.list' );

klas commented 12 years ago

I agree, this is RS issue, It tested and things work when (as suggested here http://docs.joomla.org/Creating_a_custom_form_field_type ) jimport('joomla.html.html.list');

is replaced by

jimport('joomla.form.helper'); JFormHelper::loadFieldClass('list');

This needs to be changed in both, gallery.php and gallerynorrot.php

quodo commented 12 years ago

Beautifull! A thank you to both of you, I would've never found the answer, even though I had been reading the page Klas referred to.

Just adding jimport( 'joomla.form.fields.list' ); to the file just before the class start did not work, adding jimport('joomla.form.helper'); JFormHelper::loadFieldClass('list'); did (and I'll test it futher).

Thanks for taking the time to take a look.

This is fixed in RSGallery2 SVN1073: Nightly Build available: http://www.rsgallery2.nl/nightly_builds_rsgallery2_joomla_1.61.72.5/what_will_be_new_next_version_posting_guidelines_download_16673.0.html.