nfourtythree / entriessubset Goto Github PK
View Code? Open in Web Editor NEWCraft field type plugin that extends the core Entries field type to give extra settings
License: Other
Craft field type plugin that extends the core Entries field type to give extra settings
License: Other
Hi,
Will this be updated to Craft CMS 5?
We're no longer using our licensed version of EntriesSubset on our Craft 3 site and I need to completely remove it.
I used Settings > Plugins > EntriesSubset > Uninstall and now only see Install as an option in the dropdown. The plugin's status is Missing. I've run $ composer remove
and have confirmed that the plugin files are no longer in /vendor. The plugin is not mentioned anywhere in composer.json or composer.lock. It also doesn't appear in the craft_plugins table.
When I load Settings > Plugins, the installed plugins display immediately and then EntriesSubset appears after a short pause. I am not logged into our Craft ID account.
Please don't change the project config in a migration without security checks, this will throw errors since not everyone allows admin changes in production environment.
That means releasing your plugin in production mode with the correct usage of the project config always throws exceptions for me.
Exception: Changes to the project config are not possible while in read-only mode. (/var/www/thaff/htdocs/page/vendor/craftcms/cms/src/services/ProjectConfig.php:354)
Please read this
https://docs.craftcms.com/v3/extend/project-config.html#project-config-migrations
Recently updated a Craft install to the latest version, 3.4.18 and after the update was complete Entries Subset was "broken"
Through investigating the following showed up on the fields listing for each Entries Subset field:
nfourtythree\entriessubset\fields\EntriesSubsetField
When looking at the entries with those field(s) the following was listed:
Unable to find component class 'nfourtythree\entriessubset\fields\EntriesSubsetField'.
A similar warning was on the front-end:
Class 'nfourtythree\entriessubset\fields\EntriesSubsetField' not found
A possible fix was renaming the file under vendor/nfourtythree/entriessubset/src/fields
from EntriesSubset.php
to EntriesSubsetField.php
. Doing that everything went back to working order.
Craft 3.4.18
Entries Subset 1.2.2
I think a cool feature (that seems in scope for the plugin) would be to limit entry selections to a specific level in a Structure.
Sometimes we use Structures for Landing Page > Item Listings/Categories > Individual Items
, and being able to limit only to the Listing/Category entries would frequently be useful. Currently we just include directions to only pick from a certain level, but protecting content managers from themselves is good in these cases.
I just updated Craft to Craft Pro 3.1.2.2
and the entries subtype settings seem to no longer work correctly. When I select certain channels the types for that channel are grayed-out and unselectable.
Example:
Accessories Channel Selected
Accessories Types Grayed Out
When installing this plugin with Composer 1, the following deprecation notice is output:
Deprecation Notice: Class
nfourtythree\entriessubset\fields\EntriesSubsetField
located in./vendor/nfourtythree/entriessubset/src/fields/EntriesSubset.php
does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0.
Composer 2 was released on October 24, and is now the default version that will be installed, so it’s critical that this gets resolved ASAP, or people will start getting Class not found
errors.
To fix, run the following command:
> git mv src/fields/EntriesSubset.php src/fields/EntriesSubsetField.php
Then commit your change and tag a new release.
(Note that you must use the git mv
command, as Git tends to not notice case-sensitive file renames otherwise.)
Wondering if this plugin will get updated for Craft 4?
When invoking a composer require …
as stated in the README file I get an error message.
[InvalidArgumentException]
Could not find a matching version of package nfourtythree/craft3-entriessubset. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (stable).
I also couldn't find the lib on http://packagist.org/…
I then realized that there is no way of installing it manually. It's a plugin to be installed via Craft's new plugin store.
Please, change the README file's content. It currently leads people to waste time on (not) installing things they actually can't install the documented way.
Thanks. :)
Would it be possible to make this compatible with the Reverse Entry Relations plugin? I'm not able to use an Entries Subset field as the Target Field, but with a regular Entries Field, I can.
Need to add a migration to make sure the upgrade path from 2 to 3 is seamless.
When you create a new field and delete an entryType selected in this field afterwards it will throw an error. Would you mind to check if the fetched entry type is not null please?
https://github.com/nfourtythree/craft3-entriessubset/blob/master/src/fields/EntriesSubset.php#L121
protected function inputTemplateVariables( $value = null, ElementInterface $element = null ): array
{
$vars = parent::inputTemplateVariables( $value, $element );
$settings = $this->getSettings();
if ( isset( $settings[ 'entryTypes' ] ) ) {
$entryTypes = $settings[ 'entryTypes' ];
if ($entryTypes and is_array( $entryTypes ) and !empty( $entryTypes ) ) {
foreach( $entryTypes as $typeId ) {
if ( is_numeric( $typeId ) ) {
$entryType = Craft::$app->sections->getEntryTypeById( $typeId );
if($entryType !== null){ // <--- just check if it's not null so $entryType->handle won't throw an exception
$vars[ 'criteria' ][ 'type' ][] = $entryType->handle;
}
}
}
}
}
return $vars;
}
Otherwise we would have to include your plugin to our git in order to keep this change into all our projects.
Thank you very much
I'm getting this migration error on plugin update. Running Craft 3.4.23.
yii\base\ErrorException: Invalid argument supplied for foreach()
Migration: nfourtythree\entriessubset\migrations\m190906_102859_entry_type_id_to_uid
Output:
Exception: Invalid argument supplied for foreach() (/Users/stevehurst/Sites/kalypso.craft.local/vendor/nfourtythree/entriessubset/src/migrations/m190906_102859_entry_type_id_to_uid.php:60)
#0 /Users/stevehurst/Sites/kalypso.craft.local/vendor/craftcms/cms/src/web/ErrorHandler.php(74): yii\base\ErrorHandler->handleError(2, 'Invalid argumen...', '/Users/stevehur...', 60)
#1 /Users/stevehurst/Sites/kalypso.craft.local/vendor/nfourtythree/entriessubset/src/migrations/m190906_102859_entry_type_id_to_uid.php(60): craft\web\ErrorHandler->handleError(2, 'Invalid argumen...', '/Users/stevehur...', 60, Array)
#2 /Users/stevehurst/Sites/kalypso.craft.local/vendor/craftcms/cms/src/db/Migration.php(52): nfourtythree\entriessubset\migrations\m190906_102859_entry_type_id_to_uid->safeUp()
#3 /Users/stevehurst/Sites/kalypso.craft.local/vendor/craftcms/cms/src/db/MigrationManager.php(233): craft\db\Migration->up(true)
#4 /Users/stevehurst/Sites/kalypso.craft.local/vendor/craftcms/cms/src/db/MigrationManager.php(153): craft\db\MigrationManager->migrateUp(Object(nfourtythree\entriessubset\migrations\m190906_102859_entry_type_id_to_uid))
#5 /Users/stevehurst/Sites/kalypso.craft.local/vendor/craftcms/cms/src/services/Updates.php(233): craft\db\MigrationManager->up()
#6 /Users/stevehurst/Sites/kalypso.craft.local/vendor/craftcms/cms/src/controllers/BaseUpdaterController.php(510): craft\services\Updates->runMigrations(Array)
#7 /Users/stevehurst/Sites/kalypso.craft.local/vendor/craftcms/cms/src/controllers/UpdaterController.php(203): craft\controllers\BaseUpdaterController->runMigrations(Array, 'restore-db')
#8 [internal function]: craft\controllers\UpdaterController->actionMigrate()
#9 /Users/stevehurst/Sites/kalypso.craft.local/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 /Users/stevehurst/Sites/kalypso.craft.local/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#11 /Users/stevehurst/Sites/kalypso.craft.local/vendor/craftcms/cms/src/web/Controller.php(178): yii\base\Controller->runAction('migrate', Array)
#12 /Users/stevehurst/Sites/kalypso.craft.local/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('migrate', Array)
#13 /Users/stevehurst/Sites/kalypso.craft.local/vendor/craftcms/cms/src/web/Application.php(291): yii\base\Module->runAction('updater/migrate', Array)
#14 /Users/stevehurst/Sites/kalypso.craft.local/vendor/craftcms/cms/src/web/Application.php(646): craft\web\Application->runAction('updater/migrate')
#15 /Users/stevehurst/Sites/kalypso.craft.local/vendor/craftcms/cms/src/web/Application.php(243): craft\web\Application->_processUpdateLogic(Object(craft\web\Request))
#16 /Users/stevehurst/Sites/kalypso.craft.local/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#17 /Users/stevehurst/Sites/kalypso.craft.local/public/index.php(21): yii\base\Application->run()
#18 {main}
I'm updating a site from Craft 2 to 3. The old site used EntriesSubset, and I have installed the Craft 3 version on the new site. However, I'm still seeing notices saying Unable to find component class 'EntriesSubset'.
Is it possible to retrieve the Craft 2 entry data and have the Craft 3 version of EntriesSubset read it?
After upgrading to Craft 4, I get the following error and can't apply my project config.
Your project config YAML files are expecting different versions to be installed for the following: Entries Subset
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.