Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Unknown class CFieldsMyfield error

11 years 8 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

Hi there,

I just installed the latest version of JomSocial on the latest version of Joomla 3. I'm trying to create a new custom profile field. Here are the steps I took...

1) In components/com_community/libraries/fields/customfield.xml, I added:

<field>
			<type>myfield</type>
			<name>My Field</name>
		</field>

2) I copied the contents of components/com_community/libraries/fields/select.xml and saved it in a new file in the same folder called myfield.xml. I did not make any changes to the code in this file.

3) I copied the contents of components/com_community/libraries/fields/select.php and saved it in a new file in the same folder called myfield.php. At the top I changed "class CFieldsSelect extends CProfileField" to "class CFieldsMyfield extends CProfileField".

Then I was able to go into Joomla admin and add a field with type "My Field". But when I go to the front end and try to edit my profile, it says: Unknown class CFieldsMyfield for field myfield.

I saw that other people get this error if the field is not in a group, so I already double-checked that my field is in a group.

What am I missing?

11 years 8 months ago
Licenses:

Hi Megan,

if you want create custom fields, the possibility only can do it from jomsocial backend > profiles > customize profile.

you cant changing jomsocial core files. that will make complicated things. if customize fields from backend not suitable with you purpose, I suggest you to build 3rd part extension for that.

you can hire developer if you want:
www.jomsocial.com/jomsocial-developers


Regards

11 years 8 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

I AM a developer, I'm just not familiar with JomSocial. :-/ I actually had these fields working as a Joomla User Plugin but JomSocial doesn't display the user plugins anywhere that I can find, so I'm trying to add some custom field types instead.

11 years 7 months ago
  • Paul's Avatar
  • Paul
  • Visitor
  • Thank you received: 0
Licenses:

Hi Megan,

Because Jomsocial has the ability to add custom fields from the admin interface it is counter productive to hack code to add a custom fields in Jomsocial. The feature already exists. I would recommend using the built in custom fields. We are unable to code/support a custom hack for a feature that already exists.

Attachments:
11 years 7 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

Well, I figured it out on my own. I was only missing one tiny step.

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW