Closed (fixed)
Project:
Facets
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Oct 2016 at 23:39 UTC
Updated:
3 Jan 2017 at 19:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
rocketeerbkw commentedComment #5
borisson_Looks like the javascript tests we've written for those are not passing anymore, but the changes look good otherwise, do you have the time to look at the test fails?
Comment #6
rocketeerbkw commentedYes, I'll have time to fix tests.
Comment #7
rocketeerbkw commentedI needed the facet values in JavaScript, but I had content with dashes, which broke splitting the facet id by dash. So I added two more data attributes for facet alias and facet value.
I fixed the tests for checkboxes. I started a test for dropdown, but got stuck on the last part, which fails. I'm not sure if
$dropdown->selectOption()is incorrect, or if some kind of waiting needs to happen for the URL to change.Comment #10
rocketeerbkw commentedTook awhile, but found out the dropdown test needs to wait for the page to load, unlike the checkbox test.
Comment #13
borisson_Fails on php5, not on php7 - so I figure that's because php5 is slower. Increased the sleep time. Let's see if that helps.
Comment #15
rocketeerbkw commentedNot only is it PHP 5, but it's also sqlite, which I assume is slower?
I copied the wait format from
testAddFacetand this works as expected locally (the wait condition fires for me way before the timeout). I even tried a wait of 5 minutes, and this single test passed in 42 seconds, hopefully the 6 seconds here is enough this time.Comment #17
rocketeerbkw commentedSetting timeout to 5 minutes, if this fails maybe it's actually broken?
Comment #19
borisson_I added an additional test for php5.5 + mysql and php7 + sqlite - to see if the problem is with php5 or with sqlite. Let's narrow this down.
Comment #20
borisson_The test also fails on php5 + mysql - so I'd assume something is really broken on the php side - probably in the test-code - as that's the only phpcode you've changed. I'll investigate after work.
Comment #21
rocketeerbkw commentedI was able to get test failures on a local php 5.6 with mysql and sqlite.
It looks like the ordering of the options is different? When I was selecting the nth option, that meant two different facets between the versions of PHP, and so two different URLs were being loaded. I haven't looked into how/why the ordering is different.
Poor mans interdiff:
Comment #23
rocketeerbkw commentedComment #25
borisson_Sorting in php5 vs php7 is different - that's probably the reason why.
The remaining testfail on php5 is because of #2820575: Fix rest tests. We still have to figure that out.
In the meantime - this is rtbc to me.
Comment #26
borisson_Back to NR now that #2820575: Fix rest tests has been committed.
Comment #28
rocketeerbkw commentedComment #29
borisson_Looks good to me. Assigning this to @StryKaizer for review
Comment #30
mpp commentedFor regular links it seems ok but for checkboxes, the data-drupal-facet-item-value attribute seems to be missing.
Shouldn't we add the facet data (facet id+raw_value) to the render array as well?
Comment #31
borisson_Needs work based on @mpp's tests.
Comment #32
borisson_Actually, not sure about the changes requested by @mpp. We discussed this during the monthly hangout and agreed that this is a good idea to commit. However I'd like to commit a couple of other issues first so holding off on committing today to see if the patch still applies after those were committed.
Comment #33
mpp commented@borisson_ that's fine for me
Comment #34
borisson_The patch no longer applies and I think this conflicts with #2725383: Use drupalSettings instead of data-attribute to pass config to js.
Comment #35
duaelfrI rerolled the patch and made a minor improvement to dropdown JS (see interdiff for this change).
Comment #37
borisson_Thanks for the reroll @DuaelFr and for all the hard work on this @rocketeerbkw. Sorry for taking so long before this finally got committed.