1283 Posts
Bucklash
6 years ago
Topic

Hi folks

I noticed a strange thing today.

  • If I search for something on my page, then I get some results - Cool!!
  • If I press reset (using Reset Button) and then filter I get a 404 error.
  • If I load the page, and the first thing I do is click reset and then search, I also get a 404 error....

The url at start:

https://fretroom.com.au/lesson-files

Click reset, and then filter, the url is:

https://fretroom.com.au/lesson-files?cck=&lesson_file_filter_title=&filter_file_types=&filter_bands_and_artists=&filter_notation_formats=&lesson_file_search_generic=&boxchecked=&search=&task=search

I wonder if it is to related to any 301 redirects that I have set up??

Hopefully I will get to the bottom of this, maybe you folks have experienced something similar?

Jon

Get a VIP membership
4229 Posts
Kadministrator
6 years ago
0
Level 1

Both URL's should produce the same result as all url parameters except task have no value, so I should be related to redirects you mentioned.

1283 Posts
Bucklash
6 years ago
6
Level 1

Back to this

I forgot about it until today.... 

I suppose it is doing what it is meant to do => reset all the options.

  • Redirects do not play a part in this as none of my redirects would impact it.
  • Tried reset button and submit button (as reset)... still, cck=[nothing] i.e. cck=&other_field....
  • I have tried making field read only, value and things like that but no joy.
  • I have tried putting a text field there and various ideas like that.
  • Each time, the reset button removes cck=lesson_file and replaces it with cck=[nothing]

The only work around I can see is to not use reset, and just replace it with a link to the search page ie https://fretroom.com.au/lesson-files

Anyone else have the same behaviour

To recap:

Reset button resets CCK field in search form so that it is removed as a search parameter when searching and therefore returns with no result
4229 Posts
Kadministrator
6 years ago
5
Level 2

I just tested and what happens for me with Seblod 3.12.2. is that while cck parameter is removed, correct value is still used in the query as value is protected by hidden variaon. You need to choose one of the protected variations (marked with *) for this field.

1283 Posts
Bucklash
6 years ago
4
Level 3

Hi Klas

Thanks for help

I will make some tests on localhost and see what is happening.

In them meantime, I do actually have the "hidden *" set. Not touched since list was created as the field is added by default.

1283 Posts
Bucklash
6 years ago
3
Level 4

Hi all

For those that are interested:

I have not solved this yet, 

  • I removed all my 301 redirects just in case weird funky stuff was happening from there, no change.
  • I tried a code 42 field, in each box I entered:
JRequest::setVar('cck', 'lesson_file');
  • Had no effect...
  • Instead I removed the reset button
  • I use UiKit for this site, I wonder if that is relevant, 
  • hmmm and damn it!!
121 Posts
deralex
6 years ago
2
Level 5

I've got a similar problem: With reset button, I get an Url with empty "task" and "search" parameters. I've written a little script for a custom button that keeps these values without clearing them. That works.

Quite sure reset button was ok until 3.12.2....

Also predefined live values don't persist after pressing reset button. Annoying...

1283 Posts
Bucklash
6 years ago
1
Level 6

Back to trying this again....

  • Joomla! template: Protostar
  • Joomla! version: 3.8.0
  • Seblod Version: 3.14.0
  • Seblod 'Search Form View' template: Seb Minima
  • Seblod 'List View' template: Seb List
  • Fields in Search Form: Button Rest and Button Submit (stripped everything else for testing reasons
  • Modules published: None, only content is shown
  • Result: after clicking rest button, value is stripped form hidden 'cck' field:

  • I tried with Button reset, and Button Submit -> reset
  • I also tried in code 42 field:
$jinput = JFactory::getApplication()->input;
$jinput->set('cck', 'lesson_file');<br> 

https://github.com/Octopoos/SEBLOD/issues/461

Jon

4229 Posts
Kadministrator
6 years ago
0
Level 7

Do you use custom template or override? I can't replicate this, with variation hidden* it works for me.

1283 Posts
Bucklash
6 years ago
2
Level 1

Hi Klas

I have stripped it back to protostar, seb_one for form view, seb_blog for item view, default markup, only the two fields: reset and submit.

This field has value removed, too, though not sure on it's purpose

<input type="hidden" name="boxchecked" id="boxchecked" value="0" data-cck-remove-before-search="">

becomes

<input type="hidden" name="boxchecked" id="boxchecked" value data-cck-remove-before-search="">
1283 Posts
Bucklash
6 years ago
1
Level 2

Hi folks

I found the culprit/solution...

I looked in "cck.core-3.11.3.mmin.js" (should have looked loooong ago.....)

I saw that I needed to add to my CCK field an attribute: data-cck-keep-for-search


As soon as I added this, cck value was not stripped by button_reset

1283 Posts
Bucklash
6 years ago
0
Level 3

Now... next thing is to stop Button Reset from strippng the 'search="search_type" value

hmmm'

Get a VIP membership