Skip to content

Commit

Permalink
Merge pull request #123 from contao-estatemanager/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
eki89 authored Jul 16, 2020
2 parents 57a7aba + 24ef449 commit 28a94e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/Resources/contao/classes/RealEstateImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,22 @@ protected function updateCatalog($contactPersonRecords, $realEstateRecords)

if ($realEstateRecords[$i]['AKTIONART'] === 'DELETE')
{
$preventDelete = false;

// HOOK: before real estate import
if (isset($GLOBALS['TL_HOOKS']['realEstateImportDeleteRecord']) && is_array($GLOBALS['TL_HOOKS']['realEstateImportDeleteRecord']))
{
foreach ($GLOBALS['TL_HOOKS']['realEstateImportDeleteRecord'] as $callback)
{
$this->import($callback[0]);
$this->{$callback[0]}->{$callback[1]}($objRealEstate, $objProvider, $preventDelete, $this);
}
}

if ($preventDelete)
{
continue;
}

// Delete real estate
$this->deleteRealEstateImages($objRealEstate, $objProvider);
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/contao/controllers/EstateManagerRead.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function run($module, $id)
$arrValues[] = $id;
}

$objRealEstates = RealEstateModel::findBy($arrColumns, $arrValues, $arrOptions);
$objRealEstates = RealEstateModel::findPublishedBy($arrColumns, $arrValues, $arrOptions);

if($objRealEstates === null){
return new JsonResponse($this->error(
Expand Down

0 comments on commit 28a94e4

Please sign in to comment.