Problem/Motivation

I tried to use the module in my scenario but I wasn't able to cover all the use cases.
While patching the code for me the question arose why the module relies on views but doesn't use the views ajax handling but instead does all on it's own.

Proposed resolution

Refactor the code to fully use the capabilities of the views ajax handling.
I've already re-factored vast parts of the code with and added pieces from code I wrote for another project.
Because this is quite a bit of work and a patch would be very big I decided to create a fork of the module in a sandbox: https://drupal.org/sandbox/daspeter/2165417
git clone --branch 7.x-3.x http://git.drupal.org/sandbox/daspeter/2165417.git

So what's the benefit of the re-factored code:

In my limited test-setup the stuff works as expected. However further testing is necessary!

Remaining tasks

Reviews / testers needed.

User interface changes

  • Option to toggle ajax mode for ajxa widgets is gone.
  • Removed the tooltip functionality

API changes

Whole new "API".

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eugene.ilyin’s picture

What do you offer me? Investigate your module and if I like it, to refactor my module?

das-peter’s picture

Well I offer you a reduced and hopefully more readable / easier maintainable code base in which I invested quite some time writing.
If you like the approach we could start a new branch / version for your module and pull the code from my sandbox into your module (that's why I called the branch in my sandbox already 7.x-3.x).

There's no need to do another re-factoring as I did it already. It's now up to you if you see a future for the approach.
I don't see a reason why I should create another module if there's already one.
If you find any showstopper for a merge just let me know and I see if I can solve it.

eugene.ilyin’s picture

Okay, I'll look at your code in the near future, thank you for your work.

das-peter’s picture

Sounds awesome :)
If there are any questions we can discuss those via IRC - I should be around quite often.

eugene.ilyin’s picture

Great!

eugene.ilyin’s picture

Just clarification, your patch from this issue #2035657: More flexible / defensive ajax handling. should be approved for your new functionality of ajax_facets?

das-peter’s picture

Hmm, I'm not even sure about that :) The patch is surely necessary if you want to use the search page view with ctools views content panes to split the view into pieces.

eugene.ilyin’s picture

I mean that when you refactored ajax_facets, it requires functionality from #2035657: More flexible / defensive ajax handling. for works correctly?

das-peter’s picture

I don't think so - but to give you a 100% accurate answer I would have to setup a clean installation and test that.

eugene.ilyin’s picture

Please do it. I'm waiting your answer.

das-peter’s picture

I've tested this now and the patch is required because without it the ajax configuration (the instance stored in the Drupal.views.instances['views_dom_id:' + Drupal.settings.ajax_facets.view].refreshViewAjax) of views becomes unreliable.
Btw. I found another bug while testing and fixed it - so if you've already cloned the sandbox please make sure you pull again ;)

eugene.ilyin’s picture

So, then I should wait when your patch from issue #2035657: More flexible / defensive ajax handling. will be approved.

hefox’s picture

This is a patch of -dev to -dev for use in make files so don't need to reference a sandbox project.

working nicely with the views patch.

hefox’s picture

Quick reroll cause search_api_solr => search_api (will file a separate issue for that but meh, might as well just have one patch)

hefox’s picture

Missed a file

hefox’s picture

FileSize
46.24 KB

Empty file? o.O

hefox’s picture

Note for those looking for links: the sandbox adds that :)

eugene.ilyin’s picture

I started working with new version. 7.x-3.x. Unfortunately issue #2035657 still not solved and I cannot apply changes from your fork.

Now I'm using Drupal ajax instead of custom ajax. I'm not sure that use view ajax handling is best solution, because some users want to use this module with "current search". I'll check this possibility.

Thank you for your fork and interesting to this module.

ravi.chand06’s picture

Hi,

I get the below error:

An AJAX HTTP error occurred.HTTP Result Code: 200Debugging information follows.Path: /ajax/ajax_facets/refreshStatusText: OKResponseText:

( ! ) Fatal error: Call to a member function execute_display() on a non-object in \sites\all\modules\ajax_facets\ajax_facets.pages.inc on line 43
Call Stack
# Time Memory Function Location
1 0.0000 385736 {main}( ) ..\index.php:0
2 0.5114 41635440 menu_execute_active_handler( ) ..\index.php:21
3 0.5114 41656056 call_user_func_array:{C:\wamp\www\takamolholdings\includes\menu.inc:517} ( ) ..\menu.inc:517
4 0.5114 41656576 ajax_facets_refresh_facets_content( ) ..\menu.inc:517

I created a page view and enabled the AJAX from views. Previously it triggered page SUBMIT via GET method, now it triggers AJAX but then I get the above return response.
Any suggestions would be helpfull.

Thank you.

eugene.ilyin’s picture

Which version of module do you use?

eugene.ilyin’s picture

Status: Needs review » Postponed (maintainer needs more info)
eugene.ilyin’s picture

I don't think that 7.x-3.x version will be refactored because I'll concentrate on developing of D8 version and supporting of D7 version without major changes.

Thank you all for your efforts. If you'll have some troubles, please open new issues.

eugene.ilyin’s picture

Status: Postponed (maintainer needs more info) » Fixed
eugene.ilyin’s picture

Status: Fixed » Closed (won't fix)

won't fix is more correct