Admin Fields view not loading #1010

Open
opened 2023-09-18 17:50:39 +00:00 by marcusivanhoe · 0 comments

Steps to reproduce the issue

Opening of the admin fields view, either via the Admin view Edit button or via the list button.

Expected result

To be able to edit the list of fields related to that view

Actual result

Getting the following Error

0 VDM\Joomla\Utilities\GetHelper::between(): Argument #1 ($content) must be of type string, null given, called in D:\xampp\htdocs\Andaluz\libraries\jcb_powers\VDM.Joomla\src\Utilities.php on line 397
D:\xampp\htdocs\Andaluz\libraries\jcb_powers\VDM.Joomla\src\Utilities\GetHelper.php:238

Call Stack in attached picture.

I have tried to debug on my own tracing back the call stack, I have not been able to determing why the $content variable is empty in

JROOT\administrator\components\com_componentbuilder\models\fields\fields.php:54

/**
	 * Method to get a list of options for a list input.
	 *
	 * @return	array    An array of JHtml options.
	 */
	protected function getOptions()
	{
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select($db->quoteName(array('a.id', 'a.name', 'a.xml', 'b.name'), array('id', 'field_name', 'xml', 'type')));
		$query->from($db->quoteName('#__componentbuilder_field', 'a'));
		$query->join('LEFT', '#__componentbuilder_fieldtype AS b ON b.id = a.fieldtype');
		$query->where($db->quoteName('a.published') . ' >= 1');
		$query->order('a.name ASC');
		$db->setQuery((string) $query);
		$items = $db->loadObjectList();
		$options = array();
		if ($items)
		{
			$options[] = JHtml::_('select.option', '', 'Select an option');
			foreach($items as $item)
			{
				// get the field name (TODO this could slow down the system so we will need to improve on this)
				$field_name = ComponentbuilderHelper::safeFieldName(ComponentbuilderHelper::getBetween(json_decode($item->xml),'name="','"'));
				$options[] = JHtml::_('select.option', $item->id, $item->field_name . ' [ ' . $field_name . ' - ' . $item->type . ' ]');
			}
		}

		return $options;
	}

being line 54

$field_name = ComponentbuilderHelper::safeFieldName(ComponentbuilderHelper::getBetween(json_decode($item->xml),'name="','"'));
database is working properly and the json stored data is not corrupt.

This happens to any Admin view realeted admin fields view.

System information (as much as possible)

  • OS Name & Version: Linux 4.18.0-372.19.1.lve.el7h.x86_64
  • MySql Version: 10.5.22-MariaDB-log
  • Apache Version: 2.4.57
  • PHP Version: 8.0
  • Joomla Version: 3.10.12
  • JCB Version: 3.1.25 beta (updated Today, in case this was solved in last push)
  • Browser: Opera One(versión: 101.0.4843.43) / Chromium:115.0.5790.171

Additional comments

In admin wiew, the list showing the fields of that view is working properly, so far I have been able to work arround this issue by editing the parameters in the db itself.

### Steps to reproduce the issue Opening of the admin fields view, either via the Admin view Edit button or via the list button. ### Expected result To be able to edit the list of fields related to that view ### Actual result Getting the following Error ``` 0 VDM\Joomla\Utilities\GetHelper::between(): Argument #1 ($content) must be of type string, null given, called in D:\xampp\htdocs\Andaluz\libraries\jcb_powers\VDM.Joomla\src\Utilities.php on line 397 D:\xampp\htdocs\Andaluz\libraries\jcb_powers\VDM.Joomla\src\Utilities\GetHelper.php:238 ``` Call Stack in attached picture. I have tried to debug on my own tracing back the call stack, I have not been able to determing why the $content variable is empty in JROOT\administrator\components\com_componentbuilder\models\fields\fields.php:54 ``` /** * Method to get a list of options for a list input. * * @return array An array of JHtml options. */ protected function getOptions() { $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->select($db->quoteName(array('a.id', 'a.name', 'a.xml', 'b.name'), array('id', 'field_name', 'xml', 'type'))); $query->from($db->quoteName('#__componentbuilder_field', 'a')); $query->join('LEFT', '#__componentbuilder_fieldtype AS b ON b.id = a.fieldtype'); $query->where($db->quoteName('a.published') . ' >= 1'); $query->order('a.name ASC'); $db->setQuery((string) $query); $items = $db->loadObjectList(); $options = array(); if ($items) { $options[] = JHtml::_('select.option', '', 'Select an option'); foreach($items as $item) { // get the field name (TODO this could slow down the system so we will need to improve on this) $field_name = ComponentbuilderHelper::safeFieldName(ComponentbuilderHelper::getBetween(json_decode($item->xml),'name="','"')); $options[] = JHtml::_('select.option', $item->id, $item->field_name . ' [ ' . $field_name . ' - ' . $item->type . ' ]'); } } return $options; } ``` being line 54 `$field_name = ComponentbuilderHelper::safeFieldName(ComponentbuilderHelper::getBetween(json_decode($item->xml),'name="','"')); ` database is working properly and the json stored data is not corrupt. This happens to any Admin view realeted admin fields view. ### System information (as much as possible) - OS Name & Version: Linux 4.18.0-372.19.1.lve.el7h.x86_64 - MySql Version: 10.5.22-MariaDB-log - Apache Version: 2.4.57 - PHP Version: 8.0 - Joomla Version: 3.10.12 - JCB Version: 3.1.25 beta (updated Today, in case this was solved in last push) - Browser: Opera One(versión: 101.0.4843.43) / Chromium:115.0.5790.171 ### Additional comments In admin wiew, the list showing the fields of that view is working properly, so far I have been able to work arround this issue by editing the parameters in the db itself.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#1010
There is no content yet.