masugadesign / cp-filters-craft-cms Goto Github PK
View Code? Open in Web Editor NEWAdd advanced element filtering to the Craft CMS control panel.
License: Other
Add advanced element filtering to the Craft CMS control panel.
License: Other
Proably better sales if you add higher resolution to those screenshots -- and perhaps screenshots that cover more of the features in the plugin :-)
I'm aware 3.6 only just dropped but Composer requirements prevent this being installed.
https://github.com/masugadesign/cp-filters-craft-cms/blob/master/composer.json#L8
Is your feature request related to a problem? Please describe.
Commerce store managers frequently request the ability to export orders with associated line items, shipping rules and tax rates. Craft's export lacks the key order information needed for store managers. However, if store managers could filter orders with this plugin it could help hugely with dispatch.
Describe the solution you'd like
Enable a filter on Craft Commerce orders by customer, date, products purchased, order status, shipping category, vat category, etc.
Describe alternatives you've considered
Shipstation is a third party solution for order fulfilment which works well.
I have also built simple .csv templates which store managers can download using twig templates.
Hi there,
wonderful plugin and clients love it. They have quite a few SuperTable fields though
Craft: 3.5.19.1
CPFilters : 1.1.1
I've added Supertable as a test to see if compatible with my cpfilters.php
'additionalFieldTypes' => [
'verbb\supertable\fields\SuperTableField' => ['contains']
],
While it displays the fields in the filters it does not return results. Fields have search turned on.
Has anybody succeeded in doing this yet? have you tried it yourself?
When filtering by a Related Entries Field and choosing "is assigned" the resulting Select Dropdown only shows the first 100 entries.
Expected behavior
Currently have about 600 entries and I should see all of them.
Craft Version & Installed Plugin Version
Craft: 3.6.11.2
Plugin: CP filters
Mac: Chrome and Firefox
Is your feature request related to a problem? Please describe.
I'm using CP Filters to help academics manage a database of submitted papers. They want to be able to easily pull up papers by a specific author.
Describe the solution you'd like
Allow me to filter entries by the Craft native Author metadata.
Describe alternatives you've considered
Using Searchit; sorting by author instead.
Additional context
Would like Author
as an option in addition to id
, Title
, Slug
and other native fields. I assume it's harder to implement or you would have already done it. 😅
Is your feature request related to a problem? Please describe.
I know it's already in your Roadmap, but I'd love to have these filters for Commerce Products. I have a site with over 6000 products and these filters would really help with the management of them.
Describe alternatives you've considered
If you can let me know a rough timeline for when you'll be looking to add products? If it's not soon are you happy for me to add the feature and do a PR for you?
Describe the bug
Clicking next page on users or assets tab reverts active tab to entries. Seems like its just not preserving the active tab.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
should show second page of assets!
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Hi!
Is it possible to filter unpublished entries (so they have only drafts) as well?
PS: sorry, I deleted the formalities. It's such a general question
We have some custom fields with type lightswitch, but in the filter they aren't popping up. Seems to limited to other field types only.
We created something similar internally. We found that it can be very helpful for content managers to filter entries based on the count of a specific relational field.
E.g.
Good luck with the release!
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Right now we cant pull list of folks by name
Describe the solution you'd like
A clear and concise description of what you want to happen.
Would love to add first and last name to the list of available filters
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Right now the only alternative we could come up with is creating custom fields for name which we dont love
Additional context
Add any other context or screenshots about the feature request here.
Describe the bug
Just installed on a site using Postgres and these are the screens we see. Wondering if the plugin is compatible with Postgres or if it's a different issue?
Craft Version & Installed Plugin Version
Craft: 3.5.16
Plugin: 1.0.1.1
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Expected to settings on the settings view and no errors on the plugin view.
Just a short question: Is it possible to filter across multisites? The current search in Craft is limited to the active multisite, but we want to be able to search over multiple (=all) multisites, ignoring the restriction of the normal search field. Thanks!
Describe the bug
When filtering by any field that contains a relation to other elements (Assets field, Entries field, Categories field etc) I'm getting a MySQL error. Here's the full exception message (the site's table prefix is bl_
):
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'bl_elements.id' in 'field list'
The SQL being executed was: SELECT `bl_elements`.`id`, `bl_content`.`title`, `bl_entries`.`typeId`, `bl_entries`.`sectionId`
FROM (SELECT `elements`.`id` AS `elementsId`, `elements_sites`.`id` AS `elementsSitesId`, `content`.`id` AS `contentId`, `structureelements`.`structureId`
FROM `bl_elements` `elements`
INNER JOIN `bl_entries` `entries` ON `entries`.`id` = `elements`.`id`
INNER JOIN `bl_elements_sites` `elements_sites` ON `elements_sites`.`elementId` = `elements`.`id`
INNER JOIN `bl_content` `content` ON `content`.`elementId` = `elements`.`id`
LEFT JOIN `bl_structureelements` `structureelements` ON (`structureelements`.`elementId` = `elements`.`id`) AND (EXISTS (SELECT *
FROM `bl_structures`
WHERE (`id` = `structureelements`.`structureId`) AND (`dateDeleted` IS NULL)))
WHERE (`entries`.`sectionId`='9') AND (`elements`.`archived`=FALSE) AND (`elements`.`dateDeleted` IS NULL) AND (`elements`.`draftId` IS NULL) AND (`elements`.`revisionId` IS NULL)
ORDER BY `title`) `subquery`
INNER JOIN `bl_entries` `entries` ON `entries`.`id` = `subquery`.`elementsId`
INNER JOIN `bl_elements` `elements` ON `elements`.`id` = `subquery`.`elementsId`
INNER JOIN `bl_elements_sites` `elements_sites` ON `elements_sites`.`id` = `subquery`.`elementsSitesId`
INNER JOIN `bl_content` `content` ON `content`.`id` = `subquery`.`contentId`
LEFT JOIN `bl_structureelements` `structureelements` ON (`structureelements`.`elementId` = `subquery`.`elementsId`) AND (`structureelements`.`structureId` = `subquery`.`structureId`)
ORDER BY `title`
Not sure what exectly is causing this issue. I checked the database, the bl_elements
table is there as expected, as is the id
column.
Craft Version & Installed Plugin Version
Craft: 3.7.10
Plugin: 1.1.2
To Reproduce
Expected behavior
Filtering by fields with element relations should not result in an error.
Additional context
Note sure if there's anything wrong with my installation – everything else is working fine. So I'm not sure if the steps to reproduce are complete, but I don't think I have any special plugins or modules that would mess with the database structure or the element queries, so I don't think it's just an issue with my installation.
Describe the bug
Whenever I try to filter between 2 dates, the results are not correct it seems as if the relation between the 2 dates has an OR relation.
Example:
2 different fields and dates returns the correct data.
2 same fields with different dates returns pretty much everything
EDIT: The order of the greater than and less than also makes a difference,
Even when changing the dates returns the same data:
Craft Version & Installed Plugin Version
Craft: Craft CMS 3.5.15.1
Plugin: 1.1.1
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should show a correct list between the 2 dates.
I'm trying to extend the saved filters with custom fields. One approach is to create a custom field extending the craft\fields\BaseRelationField class (similar to how Assets, Categories, Entries, Tags and Users fields do) so that you can add a saved filter as a field of a section along with the rest of the fields I need (in my case an image to show a "preview" to the user, and other fields).
I've managed to create the field after doing the following modifications to the Masuga\CpFilters\elements\SavedFilter element:
This methods need to be defined in order to show the results in a table
protected static function defineTableAttributes(): array
{
return [
'title' => \Craft::t('app', 'Title'),
'filterElementType' => \Craft::t('cpfilters', 'Type')
];
}
This method need to return an array
protected static function defineSources(string $context = null): array
{
$sources = [
[
'key' => '*',
'label' => Craft::t('cpfilters', 'Saved Filters'),
'defaultSort' => ['elements.dateCreated', 'desc']
],
];
return $sources;
}
There was a typo in the i18n key
protected static function defineSortOptions(): array
{
return [
'elements.dateCreated' => Craft::t('app', 'Date Created'),
'title' => Craft::t('cpfilters', 'Title')
];
}
I'm happy to create a PR if you find it useful.
After doing these changes I could create the custom field and use it in my entries without any problem. This is an example of a CP filter called "Artwork" being used in one of my entries
After a fresh install of the plugin, first click on CPFilters menu item throws an exception.
My setup:
PHP version | 7.4.6
Linux 4.19.76-linuxkit
PostgreSQL 11.6
Craft Pro 3.5.8
PDOException: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: integer ~~ unknown
LINE 3: WHERE "id" LIKE $1
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts. in /var/www/html/vendor/yiisoft/yii2/db/Command.php:1293
Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2/db/Command.php(1293): PDOStatement->execute()
#1 /var/www/html/vendor/yiisoft/yii2/db/Command.php(1159): yii\db\Command->internalExecute('SELECT "id"\nFRO...')
#2 /var/www/html/vendor/yiisoft/yii2/db/Command.php(444): yii\db\Command->queryInternal('fetchAll', 7)
#3 /var/www/html/vendor/yiisoft/yii2/db/Query.php(318): yii\db\Command->queryColumn()
#4 /var/www/html/vendor/craftcms/cms/src/db/Query.php(202): yii\db\Query->column(NULL)
#5 /var/www/html/vendor/craftcms/cms/src/elements/db/EntryQuery.php(926): craft\db\Query->column()
#6 /var/www/html/vendor/craftcms/cms/src/elements/db/EntryQuery.php(806): craft\elements\db\EntryQuery->_normalizeTypeId()
#7 /var/www/html/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1326): craft\elements\db\EntryQuery->beforePrepare()
#8 /var/www/html/vendor/yiisoft/yii2/db/QueryBuilder.php(227): craft\elements\db\ElementQuery->prepare(Object(craft\db\pgsql\QueryBuilder))
#9 /var/www/html/vendor/yiisoft/yii2/db/Query.php(157): yii\db\QueryBuilder->build(Object(craft\elements\db\EntryQuery))
#10 /var/www/html/vendor/yiisoft/yii2/db/Query.php(478): yii\db\Query->createCommand(Object(craft\db\Connection))
#11 /var/www/html/vendor/craftcms/cms/src/db/Query.php(259): yii\db\Query->queryScalar('COUNT(*)', NULL)
#12 /var/www/html/vendor/yiisoft/yii2/db/Query.php(366): craft\db\Query->queryScalar('COUNT(*)', NULL)
#13 /var/www/html/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1466): yii\db\Query->count('*', NULL)
#14 /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php(1499): craft\elements\db\ElementQuery->count()
#15 /var/www/html/vendor/craftcms/cms/src/helpers/Template.php(92): twig_get_attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(craft\elements\db\EntryQuery), 'count', Array, 'method', false, false)
#16 /var/www/html/storage/runtime/compiled_templates/04/04ede9db1361d6b79415374e08c63cc513b671983a5ca346f6f44e4481d807c2.php(85): craft\helpers\Template::attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(craft\elements\db\EntryQuery), 'count', Array, 'method')
#17 /var/www/html/vendor/twig/twig/src/Template.php(407): __TwigTemplate_6b8171c384834fa91853229df8c25051ad821c05b1972327e47111707557d4a7->doDisplay(Array, Array)
#18 /var/www/html/vendor/twig/twig/src/Template.php(380): Twig\Template->displayWithErrorHandling(Array, Array)
#19 /var/www/html/vendor/twig/twig/src/Template.php(392): Twig\Template->display(Array)
#20 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template->render(Array, Array)
#21 /var/www/html/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper->render(Array)
#22 /var/www/html/vendor/craftcms/cms/src/web/View.php(392): Twig\Environment->render('cpfilters/_inde...', Array)
#23 /var/www/html/vendor/craftcms/cms/src/web/View.php(453): craft\web\View->renderTemplate('cpfilters/_inde...', Array)
#24 /var/www/html/vendor/craftcms/cms/src/web/Controller.php(251): craft\web\View->renderPageTemplate('cpfilters/_inde...', Array, 'cp')
#25 /var/www/html/vendor/masugadesign/cpfilters/src/controllers/CpController.php(52): craft\web\Controller->renderTemplate('cpfilters/_inde...')
#26 [internal function]: Masuga\CpFilters\controllers\CpController->actionFilters()
#27 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#28 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams(Array)
#29 /var/www/html/vendor/craftcms/cms/src/web/Controller.php(189): yii\base\Controller->runAction('filters', Array)
#30 /var/www/html/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('filters', Array)
#31 /var/www/html/vendor/craftcms/cms/src/web/Application.php(280): yii\base\Module->runAction('cpfilters/cp/fi...', Array)
#32 /var/www/html/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('cpfilters/cp/fi...', Array)
#33 /var/www/html/vendor/craftcms/cms/src/web/Application.php(265): yii\web\Application->handleRequest(Object(craft\web\Request))
#34 /var/www/html/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#35 /var/www/html/web/index.php(21): yii\base\Application->run()
#36 {main}
Next yii\db\Exception: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: integer ~~ unknown
LINE 3: WHERE "id" LIKE $1
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
The SQL being executed was: SELECT "id"
FROM "craft_entrytypes"
WHERE "id" LIKE '%' in /var/www/html/vendor/yiisoft/yii2/db/Schema.php:677
Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2/db/Command.php(1298): yii\db\Schema->convertException(Object(PDOException), 'SELECT "id"\nFRO...')
#1 /var/www/html/vendor/yiisoft/yii2/db/Command.php(1159): yii\db\Command->internalExecute('SELECT "id"\nFRO...')
#2 /var/www/html/vendor/yiisoft/yii2/db/Command.php(444): yii\db\Command->queryInternal('fetchAll', 7)
#3 /var/www/html/vendor/yiisoft/yii2/db/Query.php(318): yii\db\Command->queryColumn()
#4 /var/www/html/vendor/craftcms/cms/src/db/Query.php(202): yii\db\Query->column(NULL)
#5 /var/www/html/vendor/craftcms/cms/src/elements/db/EntryQuery.php(926): craft\db\Query->column()
#6 /var/www/html/vendor/craftcms/cms/src/elements/db/EntryQuery.php(806): craft\elements\db\EntryQuery->_normalizeTypeId()
#7 /var/www/html/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1326): craft\elements\db\EntryQuery->beforePrepare()
#8 /var/www/html/vendor/yiisoft/yii2/db/QueryBuilder.php(227): craft\elements\db\ElementQuery->prepare(Object(craft\db\pgsql\QueryBuilder))
#9 /var/www/html/vendor/yiisoft/yii2/db/Query.php(157): yii\db\QueryBuilder->build(Object(craft\elements\db\EntryQuery))
#10 /var/www/html/vendor/yiisoft/yii2/db/Query.php(478): yii\db\Query->createCommand(Object(craft\db\Connection))
#11 /var/www/html/vendor/craftcms/cms/src/db/Query.php(259): yii\db\Query->queryScalar('COUNT(*)', NULL)
#12 /var/www/html/vendor/yiisoft/yii2/db/Query.php(366): craft\db\Query->queryScalar('COUNT(*)', NULL)
#13 /var/www/html/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1466): yii\db\Query->count('*', NULL)
#14 /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php(1499): craft\elements\db\ElementQuery->count()
#15 /var/www/html/vendor/craftcms/cms/src/helpers/Template.php(92): twig_get_attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(craft\elements\db\EntryQuery), 'count', Array, 'method', false, false)
#16 /var/www/html/storage/runtime/compiled_templates/04/04ede9db1361d6b79415374e08c63cc513b671983a5ca346f6f44e4481d807c2.php(85): craft\helpers\Template::attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(craft\elements\db\EntryQuery), 'count', Array, 'method')
#17 /var/www/html/vendor/twig/twig/src/Template.php(407): __TwigTemplate_6b8171c384834fa91853229df8c25051ad821c05b1972327e47111707557d4a7->doDisplay(Array, Array)
#18 /var/www/html/vendor/twig/twig/src/Template.php(380): Twig\Template->displayWithErrorHandling(Array, Array)
#19 /var/www/html/vendor/twig/twig/src/Template.php(392): Twig\Template->display(Array)
#20 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template->render(Array, Array)
#21 /var/www/html/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper->render(Array)
#22 /var/www/html/vendor/craftcms/cms/src/web/View.php(392): Twig\Environment->render('cpfilters/_inde...', Array)
#23 /var/www/html/vendor/craftcms/cms/src/web/View.php(453): craft\web\View->renderTemplate('cpfilters/_inde...', Array)
#24 /var/www/html/vendor/craftcms/cms/src/web/Controller.php(251): craft\web\View->renderPageTemplate('cpfilters/_inde...', Array, 'cp')
#25 /var/www/html/vendor/masugadesign/cpfilters/src/controllers/CpController.php(52): craft\web\Controller->renderTemplate('cpfilters/_inde...')
#26 [internal function]: Masuga\CpFilters\controllers\CpController->actionFilters()
#27 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#28 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams(Array)
#29 /var/www/html/vendor/craftcms/cms/src/web/Controller.php(189): yii\base\Controller->runAction('filters', Array)
#30 /var/www/html/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('filters', Array)
#31 /var/www/html/vendor/craftcms/cms/src/web/Application.php(280): yii\base\Module->runAction('cpfilters/cp/fi...', Array)
#32 /var/www/html/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('cpfilters/cp/fi...', Array)
#33 /var/www/html/vendor/craftcms/cms/src/web/Application.php(265): yii\web\Application->handleRequest(Object(craft\web\Request))
#34 /var/www/html/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#35 /var/www/html/web/index.php(21): yii\base\Application->run()
#36 {main}
Additional Information:
Array
(
[0] => 42883
[1] => 7
[2] => ERROR: operator does not exist: integer ~~ unknown
LINE 3: WHERE "id" LIKE $1
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
)
Just installed on a multi-site but I can only see entries from the default site. Is this something that you guys plan to add anytime soon?
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.