Closed (fixed)
Project:
Search API
Version:
8.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
1 Apr 2014 at 21:11 UTC
Updated:
1 Sep 2015 at 14:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
drunken monkeyComment #2
p-neyens commentedComment #3
rosinegrean commentedI'm not sure if p-neyens is still working on this, but here is a patch for it.
Comment #4
drunken monkeyGreat, thanks a lot!
Already looks quite good, I just had some style changes. Patch attached.
Also, there are a few other changes I'd like to discuss before committing:
- First off, it would be great if we could add a test for this. Maybe just in the
IntegrationTestuse this button when creating an index.- The "Delete" button/link has some special code to keep the
destinationGET parameter intact. Should we add that here, too?Comment #5
rosinegrean commentedHello,
I've added a test for this button in
IntegrationTestlike you mentioned.For the destination issue, I'm not sure if this is the case. I tried to apply the same logic as for delete, but since the entity is not created yet i could not get the "fields" url in a clean way. In your patch i saw you changed
$form_state->setRedirect('entity.search_api_index.fields', array('search_api_index' => $this->getEntity()->id()));with
$form_state->setRedirectUrl($this->getEntity()->urlInfo('fields'));Should i use for destination the first approach ? Or do you know something better ?
Comment #7
rosinegrean commentedSorry for that, for some reason i can't run tests for Search API on my local machine because PHP crashes.
Hope this new patch will do the trick.
Comment #9
drunken monkeyThanks for the additional work!
Ah, let's just forget about the destination there. I don't think a redirect after creating an index is as much of a use case as after deleting it.
I think the bug in the test was that you do a
drupalPostForm()on the current page (which is the old index's view page) instead of on the "Add index" page. Revised patch attached, hopefully this one will work.Comment #11
drunken monkeyComment #12
rosinegrean commentedThanks, looks good to me now.
Not sure why the test did not run, but after it passes i will mark it reviewed.
Comment #13
rosinegrean commentedGood to go
Comment #14
drunken monkeyGreat, committed.
Thanks again!