Well, I really don't know what is the problem here and why it never came out (probably I have a misconfiguration somewhere...)

When I search for some nodes using the Flexinode search, both "sort header" and pager gets an "edit=Array" query string. Now, this problem does not happen with 4.7 because it got a big core change and also because (it seems to me) Flexinode changed to use the core search mechanism.

This patch does not touch Drupal core, but fixes the problem by doing two simple things:
* clears the POST "edit" variable
* adds an encoded string that will be used by the current system

Solving the problem and allowing the correct functionality of both sort and pager.

Hope you like it.

Comments

magico’s picture

Status: Active » Needs review
Bèr Kessels’s picture

Status: Needs review » Needs work

First: watch your coding style } else { should be

{ 
else {

Second: I am not sure if I understand what you are trying to achieve with all the base46 conversions.

Bèr Kessels’s picture

eerrm that should have been

}
else {

off course :)

magico’s picture

Well, what I want is that the serialized array is converted to a base64 string that garanties it will be correctly passed as a query string parameter. I don't know how could I explain better, but you can confirm that this bug exists in Drupal 4.6, just doing the following:
* create a flexinode
* add several nodes, until you have enough items to have more than one page
* do a flexinode search
* try to go, for example, to the page 2
* in the url you'll have "edit=Array"

This code tries to solve this, by "unseting" the edit variable, and changing it for a "string" variable containing the original edit array parameters.

If it's ok for you, I'll work the patch.

Bèr Kessels’s picture

Its okay with me. Just that I never encountered this solution in Drupal. and that it sounds somewhat hackish. But, if it works, and if it requires only these relative small changes, I am happy to test and commit a patch.

So, yes, please work on the patch a little :)

magico’s picture

Status: Needs work » Needs review
StatusFileSize
new1.52 KB

Here it is with the coding style correct. I'm sorry if you find another coding style problem, it's difficult sometimes to adjust the coding styles to different projects (that I do not control).

Bèr Kessels’s picture

Fixed this in Flexinode 4.6 brach. Thanks a lot, and don't mind the coding style too much. Its just that I am quite swamped with flexinode issues, so I am trying to get other people to do as much work as possible: Instead of rewriting the patch myself, I now learned you something abuot Drupal coding style, and saed myself some work :)

Bèr Kessels’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)