Welcome, Guest
Username: Password: Remember me

TOPIC: Unable to select beyond 2nd level within form

Unable to select beyond 2nd level within form 14 Mar 2018 22:47 #15509

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Hello Admin

Can you resolve this please? Cook is unable to select fields beyond the second level within a form. However, it can resolve the same field selection if it is placed in a filter combo. I am trying to get the name of the user but only get fields from the first linked table.

Thanks
V

The administrator has disabled public write access.

Unable to select beyond 2nd level within form 16 Mar 2018 04:24 #15512

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Hello Admin

Not having alot of time to play with, I was able to resolve this issue quickly by adding ORM functionality to the addSelect routine (see below). I don't know if you would consider looking at whats possible in the near future, but would love to see this limitation resolved so decided to share my 10min approach.

Best regards
v

USAGE:
\components\com_xxx\fork\views\users\view.html.php
	case 'assigned_to':
	/* Ajax List : Users
	 * Called from: view:job, layout:job
	 */
		$model = $this->getModel();
		$model->addSelect(array(
				'userid.name'
		));
		$items = $model->getItems();

MODIFIED ROUTINE:
\administrator\components\com_xxx\fork\classes\model\list.php
	/**
	* Method to store a SELECT entry for the SQL query.
	*
	* @access	public
	* @param	string	$select	
	*
	* @return	void
	*/
	public function addSelect($select)
	{
		if (!is_array($select))
			$this->addQuery('select', $select);

		if (is_array($select))
			$this->orm->select(array(
					$select
			));
	}
The administrator has disabled public write access.
Time to create page: 0.061 seconds

Get Started