Skip to content

Commit

Permalink
Merge branch '4.2-dev' into patch-4
Browse files Browse the repository at this point in the history
  • Loading branch information
alikon committed May 31, 2022
2 parents a874bc7 + bc6e6ec commit fa76795
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 64 deletions.
6 changes: 3 additions & 3 deletions libraries/src/MVC/Model/AdminModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ protected function batchCopy($value, $pks, $contexts)
}

$newIds = array();
$db = $this->getDbo();
$db = $this->getDatabase();

// Parent exists so let's proceed
while (!empty($pks))
Expand Down Expand Up @@ -935,7 +935,7 @@ public function delete(&$pks)
// Multilanguage: if associated, delete the item in the _associations table
if ($this->associationsContext && Associations::isEnabled())
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select(
[
Expand Down Expand Up @@ -1449,7 +1449,7 @@ public function save($data)
}

// Get associationskey for edited item
$db = $this->getDbo();
$db = $this->getDatabase();
$id = (int) $table->$key;
$query = $db->getQuery(true)
->select($db->quoteName('key'))
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/MVC/Model/ListModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public function getItems()
*/
protected function getListQuery()
{
return $this->getDbo()->getQuery(true);
return $this->getDatabase()->getQuery(true);
}

/**
Expand Down
60 changes: 0 additions & 60 deletions plugins/system/fields/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\Component\Fields\Administrator\Helper\FieldsHelper;
use Joomla\Component\Finder\Administrator\Indexer\Indexer;
use Joomla\Registry\Registry;

/**
Expand Down Expand Up @@ -502,65 +501,6 @@ public function onContentPrepare($context, $item)
}
}

/**
* @param \Joomla\Component\Finder\Administrator\Indexer\Result $item The item
*
* @return boolean
*
* @since 3.7.0
*/
public function onPrepareFinderContent($item)
{
$section = strtolower($item->layout);
$tax = $item->getTaxonomy('Type');

if ($tax)
{
foreach ($tax as $context => $value)
{
// This is only a guess, needs to be improved
$component = strtolower($context);

if (strpos($context, 'com_') !== 0)
{
$component = 'com_' . $component;
}

// Transform com_article to com_content
if ($component === 'com_article')
{
$component = 'com_content';
}

// Create a dummy object with the required fields
$tmp = new stdClass;
$tmp->id = $item->__get('id');

if ($item->__get('catid'))
{
$tmp->catid = $item->__get('catid');
}

// Getting the fields for the constructed context
$fields = FieldsHelper::getFields($component . '.' . $section, $tmp, true);

if (is_array($fields))
{
foreach ($fields as $field)
{
// Adding the instructions how to handle the text
$item->addInstruction(Indexer::TEXT_CONTEXT, $field->name);

// Adding the field value as a field
$item->{$field->name} = $field->value;
}
}
}
}

return true;
}

/**
* Prepares a tag item to be ready for com_fields.
*
Expand Down

0 comments on commit fa76795

Please sign in to comment.