Skip to content

Commit 751e8a2

Browse files
committed
Merge branch 'master' of github.com:numero2/contao-opengraph3
2 parents f03c879 + 53d0665 commit 751e8a2

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

src/Resources/contao/classes/OpenGraphCalendarEvents.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ class OpenGraphCalendarEvents {
2424

2525

2626
/**
27-
* Appends OpenGraph data from news articles
27+
* Appends OpenGraph data from events
2828
*
2929
* @param $objModule
3030
*/
3131
public static function addModuleData( $objModule ): void {
3232

3333
$calendars = StringUtil::deserialize($objModule->cal_calendar, true);
34-
$event = CalendarEventsModel::findPublishedByParentAndIdOrAlias(Input::get('auto_item'), $calendars);
34+
$event = CalendarEventsModel::findPublishedByParentAndIdOrAlias((Input::get('auto_item') ?? ''), $calendars);
3535

3636
// Check if the calendar event could get loaded from the database
3737
if (null === $event) {

src/Resources/contao/classes/OpenGraphIsotope.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class OpenGraphIsotope {
3535
public static function addModuleData( $objModule ): void {
3636

3737
$objProduct = NULL;
38-
$objProduct = Product::findAvailableByIdOrAlias( Input::get('auto_item') );
38+
$objProduct = Product::findAvailableByIdOrAlias( (Input::get('auto_item') ?? '') );
3939

4040
if( null !== $objProduct ) {
4141

src/Resources/contao/classes/OpenGraphNews.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static function addModuleData( $objModule ): void {
3535
$newsArchives = StringUtil::deserialize($objModule->news_archives);
3636

3737
$objArticle = NULL;
38-
$objArticle = NewsModel::findPublishedByParentAndIdOrAlias(Input::get('auto_item'), $newsArchives);
38+
$objArticle = NewsModel::findPublishedByParentAndIdOrAlias((Input::get('auto_item') ?? ''), $newsArchives);
3939

4040
if( null !== $objArticle ) {
4141

src/Resources/contao/classes/OpenGraphStoreLocator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static function addModuleData( $objModule ): void {
3333
$alias = Input::get('auto_item') ? Input::get('auto_item') : Input::get('store');
3434

3535
$objStore = NULL;
36-
$objStore = StoresModel::findByIdOrAlias( $alias );
36+
$objStore = StoresModel::findByIdOrAlias( ($alias ?? '') );
3737

3838
if( null !== $objStore ) {
3939

src/Resources/contao/widgets/OpenGraphProperties.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,13 @@ protected function generateWidgetsDCA( $value=null ): array {
372372

373373
foreach( $value as $keyRow => $row ) {
374374

375-
if( !array_key_exists($row[0], $options) ){
376-
unset($this->varValue[$keyRow]);
377-
$removedValues = true;
375+
if( !array_key_exists($row[0], $options) ) {
376+
377+
if( is_array($this->varValue) && array_key_exists($keyRow, $this->varValue) ) {
378+
unset($this->varValue[$keyRow]);
379+
$removedValues = true;
380+
}
381+
378382
continue;
379383
}
380384

0 commit comments

Comments
 (0)