• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Class "JSFactory" not found

Class "JSFactory" not found 1 year 1 month ago #42641

  • admin065
  • admin065's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 1
Since updating to Joomla 4.x, one of my RSForms isnt working anymore..

Its the one where I use code to prefill some fields for example with:
//<code>
$user = JSFactory::getUser();
return $user->get('city');
//</code>

The page only shows: "0 Class "JSFactory" not found"

See: www.kaesereitrachsel.ch/partner


Any ideas, what to do?
The administrator has disabled public write access.

Class "JSFactory" not found 1 year 1 month ago #42644

  • gunerguk
  • gunerguk's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 29
  • Thank you received: 3
I have the same error after Joomla 4 and PHP 8.1. It worked after removing the field with the code. Any solution?
The administrator has disabled public write access.

Class "JSFactory" not found 1 year 1 month ago #42645

  • admin065
  • admin065's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 1
I got a response from support, that solved it for me, hopefully for you too.
Hello,

I'm not sure where you got that piece of code from - JSFactory has never been a class in the Joomla! framework, it's most probably a typo - it should read JFactory:

//<code>
$user = JFactory::getUser();
return $user->get('city');
//</code>

Regards
The administrator has disabled public write access.
The following user(s) said Thank You: gunerguk

Class "JSFactory" not found 1 year 1 month ago #42646

  • gunerguk
  • gunerguk's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 29
  • Thank you received: 3
Thank you and sorry that I haven't noticed the typo error you had. Mine was a little different.
//<code>
	$articleid=JRequest::getInt('id');  //gets the article's ID from the URL
	$db = JFactory::getDBO();  //opens a new database connection
	$db-&gt;setQuery("SELECT `title` FROM #__content WHERE `id`='$articleid'");
	//gets the article's title based on its ID
	$result=$db-&gt;loadResult();
	if($result){
	$_POST['form']['Title']=$result;  //assigns the article's title as the hidden field's value
	return $db-&gt;loadResult();
}
//</code>

The error given is as this:
0
syntax error, unexpected token "<", expecting end of file

The code above was working before upgrading to Joomla 4 and PHP 8.1. When I disable the free text field the form works again. Any advice would be much appreciated.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!