Skip to content

Commit

Permalink
fixed issue with error when all entry types is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
nfourtythree committed Mar 14, 2016
1 parent ba65d67 commit 342617b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
4 changes: 2 additions & 2 deletions EntriesSubsetPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @copyright Copyright (c) 2016 nfourtythree
* @link http://n43.me
* @package EntriesSubset
* @since 1.0.0
* @since 0.5.0
*/

namespace Craft;
Expand Down Expand Up @@ -93,7 +93,7 @@ public function getReleaseFeedUrl()
*/
public function getVersion()
{
return '0.5.0';
return '0.5.1';
}

/**
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ When creating a new field the extra options for `EntryType` will appear when sel

## Entries Subset Changelog

### 0.5.1 -- 2016.03.14

* Initial release

### 0.5.0 -- 2016.02.17

* Initial release
Expand Down
12 changes: 7 additions & 5 deletions fieldtypes/EntriesSubsetFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @copyright Copyright (c) 2016 nfourtythree
* @link http://n43.me
* @package EntriesSubset
* @since 1.0.0
* @since 0.5.0
*/

namespace Craft;
Expand Down Expand Up @@ -70,10 +70,12 @@ public function getInputTemplateVariables($name, $criteria)

$entryTypes = $this->getSettings()->entryTypes;

foreach($this->getSettings()->entryTypes as $typeId) {
if ($typeId != "*") {
$entryType = craft()->sections->getEntryTypeById($typeId);
$variables['criteria']['type'][] = $entryType->handle;
if ($entryTypes and is_array($entryTypes)) {
foreach($entryTypes as $typeId) {
if ($typeId != "*") {
$entryType = craft()->sections->getEntryTypeById($typeId);
$variables['criteria']['type'][] = $entryType->handle;
}
}
}

Expand Down
8 changes: 8 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"version": "0.5.1",
"downloadUrl": "https://github.com/nfourtythree/entriessubset/archive/master.zip",
"date": "2016-03-14T12:00:00.111Z",
"notes": [
"[Added] Initial release"
]
},
{
"version": "0.5.0",
"downloadUrl": "https://github.com/nfourtythree/entriessubset/archive/master.zip",
Expand Down
2 changes: 1 addition & 1 deletion templates/fields/settings.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @copyright Copyright (c) 2016 nfourtythree
* @link http://n43.me
* @package EntriesSubset
* @since 1.0.0
* @since 0.5.0
*/
#}

Expand Down

0 comments on commit 342617b

Please sign in to comment.