Closed (fixed)
Project:
Country
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Mar 2018 at 16:44 UTC
Updated:
28 Sep 2018 at 08:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
nkoporecHi, same issue for me, running Drupal 8.5...it seems like the filter is not working at all, even if you select autocomplete, the error is gone but it still shows all records(no filter applied)...I think we need to create a patch to completely rewrite query function(currently query only runs if you select autocomplete).
Comment #3
nkoporecworking on a patch.
Comment #4
nkoporecCreated a patch, rewrote the query function, so both(autocomplete and dropdown) filter is working.When the patch is applied the module must be reinstalled(to load a new view schema).
Comment #5
nkoporecComment #6
icurk commentedPatch works great. But I would add an update hook, which will update the configuration schema. This will update configuration items for existing users of the module who already had it installed before the changes.
Comment #7
dakalaThanks for reporting this and taking it on. I'll take a look at the patch today or tomorrow. Once again, thanks.
Comment #8
alesbencina commentedHello, I have tested the patch and it's working on Drupal 8.4 version.
Comment #9
nkoporecCreated a patch with fixed issues that @icurk raised.
Comment #10
riddhi.addweb commented@nkoporec, Thanks for providing the patch, But after applying the patch. It still throws the same error to me can you please provide the new patch or else guide me if i'm wrong.
Comment #11
nkoporec@riddhi.addweb hmm...maybe try running Cron manually?
Comment #12
lobsterr commented@nkoropec Thank you for your patch
I carefully checked your patch and found some issues. I'm not sure it is a bug in views or in country module. I will assume it is in the country module, because it works with other modules in the views for me.
1) Widget Autocomplete
it doesn't apply any filters and it doesn't save selected countries. It happens for any types of filters
2) Widget Dropdown
It works for any kind of filters, but in the dropdown we have "Select all" value, which I think should not be there.
It doesn't allow us to select all values, because it adds filter like this
WHERE ((node__field_country.field_country_value = 'all'))and user interface it displayed as "Unknown"
Comment #13
nkoporecHi @LOBsTerr, here is a new patch which fixes issues that you raised.The select all remains(but it's working now) since it can't be removed.Please reviewed it.
Comment #14
lobsterr commented@nkoropec - Thank you for your contribution. I have tested it.
The Dropdown widget works ok now, but Autocomplete widget doesn't show in the UI selected countries
Comment #15
alesbencina commentedHi, @LOBsTerr I cannot reproduce the problem you are mentioning. Can you please give us more information about the issue, please?
Comment #16
lobsterr commentedSteps to reproduce
1) Set Autocomplete widget
2) Find any country, for example France
3) In the "Filter Criteria" section I don't see selected country.
Expected behavior, I should see (= France)
If we use Dropdown widget and select, for example France country. I see the select countries.
I hope it will help.
Comment #17
nkoporecThanks for reviewing my patch! Yeah, this is a small visual issue, which can be confusing(otherwise the filter works as expected) ... The issue exists because we extend ManyToOne which has the select type per default and if we select autocomplete we override the form type and set it to textfield, error appears since views are expecting select with the #options parameter, but it gets textfield with no #options(it's empty that's why no (=) is shown).We could extend StringFilter instead of ManyToOne which will work for autocomplete but than we got a similar issue with dropdown...
Comment #18
hkirsman commentedNote that this patch applies only for dev branch.
Comment #19
hkirsman commentedAnd sort of trivial fix should be made. If you go to update.php and see the list of updates then for this module it says: "Implements hook_update_N()." while it should say something like "Update the configuration schema". Took that from your comments, name it better :)
Comment #20
leksat commentedI've got "The configuration property doesn't exist" error recently during an update of Drupal core from 8.1 to 8.3.
I tried to
- update the country module to the latest dev version
- use the patches from this issue
Nothing helped.
Here is the fix that I have used: https://github.com/AmazeeLabs/country/commit/ff5eb45a3a81e377cc55dc39c20...
It works for me, but I was in a great hurry (SA-CORE-2018-002 ;P), so better if someone else can test it as well.
Comment #21
dakalaI've now had a chance to check this bug. After applying the patch here - https://www.drupal.org/project/country/issues/2760243 and https://github.com/AmazeeLabs/country/commit/ff5eb45a3a81e377cc55dc39c20... (and a hook_update) seemed to have fixed the InvalidArgumentException and both dropdown and autocomplete widget work.
Changes are in the updated dev branch. Could we have some confirmation please? Thanks for the good work!
Comment #23
dakala@nkoporec, I've applied the rest of your patch. Filtering works fine and it seems to have partially resolved https://www.drupal.org/project/country/issues/2918968. Briefly, if I select "is all of" filter operator and say I have a node with Panama and Croatia, and another node with Croatia and I filter by "Panama and Croatia" I expect it to return the first one. However, it returns both of them.
Anyways thanks for the patch!
Comment #24
dakalaComment #25
dakala