I'm sure you have noticed that when you navigate through issues and apply some filters you receive some "Expired document" errors.
Filters are sent through POST so when you click back to a page that has received a POST form you get a expired error.
Example:
Go to issues > Click on Closed > then click on an issue > then click back on browser > ERROR
I see these solutions:
Listing detects POST formDetect POST on Listing controller and redirect to self after updating the state of the model.
We can detect the form checking if a field has been sent (example filter-status):
// Received post form > reload to avoid expired pages
$status = $application->input->post->get('filter-status');
if (null != $status)
{
$application->redirect(
$application->get('uri.base.path')
. 'tracker/' . $project->alias
);
}or directly any POST form:
// Received post form > reload to avoid expired pages
if (!empty($_POST))
{
$application->redirect(
$application->get('uri.base.path')
. 'tracker/' . $project->alias
);
}The filter form is sent to tracker/:project_alias/filter and after setting the state it redirects back to Listing
In this point we would need to move the code that populates the model state to ¿the model? Because it will be called from both Listing and Filter controllers.
I'm not sure if the populateState method is not in the framework to avoid dealing with requests on models so advice here would be appreciated.
The benefits here would be being able to copy&paste any filter on skype, save searches as bookmarks (i.e. you search "code style")....
The only problem are the ugly URLs (example: http://jissues.local/tracker/joomla-cms?filter-search=code+style&filter-sort=0&filter-stage=0&filter-priority=3&filter-status=0 ) but if Google can live with it maybe we too filter-
So what do you think is the best solution?
I think the GET forms is the more practical solution.
Are those personal filters intended to be private? I mean I save a filter for "code style" but can I share it? If yes the GET conversion will be good too
I think we should go with option 3.
About the "ugly" URLs: I think we could add a "save query" option that stores the parameters to a table to generate "nice" URLS like ?search-query=123 or even ?search-query=my-search-alias
Does that make sense ?
I am not in favor for using DB to generate URLs...
I've met that problem too and I'm for option 3, I think it's good for users too.
BTW, what about changing this to AJAX with jQuery?
what about changing this to AJAX with jQuery?
I was thinking about it, but it's not so easy to implement.
@allenzhaocn that could be great. Are you thinkg about the same approach that GitHub have?
@b2z Actually I don't know how github finishes that. Do you mean the Ajax way they're using or just the ui and auto-complete features?
Cheers,
Allen
在 2014年3月9日,下午6:45,Dmitry Rekun notifications@github.com 写道:
@allenzhaocn that could be great. Are you thinkg about the same approach that GitHub have?
—
Reply to this email directly or view it on GitHub.
I mean the way how they udpate the list on filters' change.
OK I get that, sorry I had a little misunderstanding up there, it's like we are always talking about the two things...
| Description | <p>I'm sure you have noticed that when you navigate through issues and apply some filters you receive some "Expired document" errors.</p> <h2>The problem</h2> <p>Filters are sent through POST so when you click back to a page that has received a POST form you get a expired error. </p> <p><strong>Example</strong>:<br> Go to issues > Click on <em>Closed</em> > then click on an issue > then click back on browser > ERROR</p> <h2>Solutions</h2> <p>I see these solutions:</p> <h3>1.- <code>Listing</code> detects POST form</h3> <p>Detect POST on <code>Listing</code> controller and redirect to self after updating the state of the model. </p> <p>We can detect the form checking if a field has been sent (example filter-status):</p> <div class="highlight highlight-php"><pre> <span class="c1">// Received post form > reload to avoid expired pages</span> <span class="nv">$status</span> <span class="o">=</span> <span class="nv">$application</span><span class="o">-></span><span class="na">input</span><span class="o">-></span><span class="na">post</span><span class="o">-></span><span class="na">get</span><span class="p">(</span><span class="s1">'filter-status'</span><span class="p">);</span> <span class="k">if</span> <span class="p">(</span><span class="k">null</span> <span class="o">!=</span> <span class="nv">$status</span><span class="p">)</span> <span class="p">{</span> <span class="nv">$application</span><span class="o">-></span><span class="na">redirect</span><span class="p">(</span> <span class="nv">$application</span><span class="o">-></span><span class="na">get</span><span class="p">(</span><span class="s1">'uri.base.path'</span><span class="p">)</span> <span class="o">.</span> <span class="s1">'tracker/'</span> <span class="o">.</span> <span class="nv">$project</span><span class="o">-></span><span class="na">alias</span> <span class="p">);</span> <span class="p">}</span> </pre></div> <p>or directly any POST form:</p> <div class="highlight highlight-php"><pre> <span class="c1">// Received post form > reload to avoid expired pages</span> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">empty</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">))</span> <span class="p">{</span> <span class="nv">$application</span><span class="o">-></span><span class="na">redirect</span><span class="p">(</span> <span class="nv">$application</span><span class="o">-></span><span class="na">get</span><span class="p">(</span><span class="s1">'uri.base.path'</span><span class="p">)</span> <span class="o">.</span> <span class="s1">'tracker/'</span> <span class="o">.</span> <span class="nv">$project</span><span class="o">-></span><span class="na">alias</span> <span class="p">);</span> <span class="p">}</span> </pre></div> <h3>2.- Send filter form to another controller</h3> <p>The filter form is sent to <code>tracker/:project_alias/filter</code> and after setting the state it redirects back to <code>Listing</code></p> <p>In this point we would need to move the code that populates the model state to ¿the model? Because it will be called from both <code>Listing</code> and <code>Filter</code> controllers. </p> <p>I'm not sure if the <code>populateState</code> method is not in the framework to avoid dealing with requests on models so advice here would be appreciated.</p> <h3>3.- Convert filter forms to GET</h3> <p>The benefits here would be being able to copy&paste any filter on skype, save searches as bookmarks (i.e. you search "code style")....</p> <p>The only problem are the ugly URLs (example: <a href="http://jissues.local/tracker/joomla-cms?filter-search=code+style&filter-sort=0&filter-stage=0&filter-priority=3&filter-status=0">http://jissues.local/tracker/joomla-cms?filter-search=code+style&filter-sort=0&filter-stage=0&filter-priority=3&filter-status=0</a> ) but if Google can live with it maybe we too <img class="emoji" title=":dancers:" alt=":dancers:" src="https://assets-cdn.github.com/images/icons/emoji/dancers.png" height="20" width="20" align="absmiddle"> If we go for this I suggest to change the name of the vars to remove <code>filter-</code></p> <p>So what do you think is the best solution?</p> <p>I think the GET forms is the more practical solution.</p> | ⇒ | <p>I'm sure you have noticed that when you navigate through issues and apply some filters you receive some "Expired document" errors.</p> <h2>The problem</h2> <p>Filters are sent through POST so when you click back to a page that has received a POST form you get a expired error. </p> <p><strong>Example</strong>:<br> Go to issues > Click on <em>Closed</em> > then click on an issue > then click back on browser > ERROR</p> <h2>Solutions</h2> <p>I see these solutions:</p> <h3>1.- <code>Listing</code> detects POST form</h3> <p>Detect POST on <code>Listing</code> controller and redirect to self after updating the state of the model. </p> <p>We can detect the form checking if a field has been sent (example filter-status):</p> <div class="highlight highlight-php"><pre> <span class="c1">// Received post form > reload to avoid expired pages</span> <span class="nv">$status</span> <span class="o">=</span> <span class="nv">$application</span><span class="o">-></span><span class="na">input</span><span class="o">-></span><span class="na">post</span><span class="o">-></span><span class="na">get</span><span class="p">(</span><span class="s1">'filter-status'</span><span class="p">);</span> <span class="k">if</span> <span class="p">(</span><span class="k">null</span> <span class="o">!=</span> <span class="nv">$status</span><span class="p">)</span> <span class="p">{</span> <span class="nv">$application</span><span class="o">-></span><span class="na">redirect</span><span class="p">(</span> <span class="nv">$application</span><span class="o">-></span><span class="na">get</span><span class="p">(</span><span class="s1">'uri.base.path'</span><span class="p">)</span> <span class="o">.</span> <span class="s1">'tracker/'</span> <span class="o">.</span> <span class="nv">$project</span><span class="o">-></span><span class="na">alias</span> <span class="p">);</span> <span class="p">}</span> </pre></div> <p>or directly any POST form:</p> <div class="highlight highlight-php"><pre> <span class="c1">// Received post form > reload to avoid expired pages</span> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">empty</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">))</span> <span class="p">{</span> <span class="nv">$application</span><span class="o">-></span><span class="na">redirect</span><span class="p">(</span> <span class="nv">$application</span><span class="o">-></span><span class="na">get</span><span class="p">(</span><span class="s1">'uri.base.path'</span><span class="p">)</span> <span class="o">.</span> <span class="s1">'tracker/'</span> <span class="o">.</span> <span class="nv">$project</span><span class="o">-></span><span class="na">alias</span> <span class="p">);</span> <span class="p">}</span> </pre></div> <h3>2.- Send filter form to another controller</h3> <p>The filter form is sent to <code>tracker/:project_alias/filter</code> and after setting the state it redirects back to <code>Listing</code></p> <p>In this point we would need to move the code that populates the model state to ¿the model? Because it will be called from both <code>Listing</code> and <code>Filter</code> controllers. </p> <p>I'm not sure if the <code>populateState</code> method is not in the framework to avoid dealing with requests on models so advice here would be appreciated.</p> <h3>3.- Convert filter forms to GET</h3> <p>The benefits here would be being able to copy&paste any filter on skype, save searches as bookmarks (i.e. you search "code style")....</p> <p>The only problem are the ugly URLs (example: <a href="http://jissues.local/tracker/joomla-cms?filter-search=code+style&filter-sort=0&filter-stage=0&filter-priority=3&filter-status=0">http://jissues.local/tracker/joomla-cms?filter-search=code+style&filter-sort=0&filter-stage=0&filter-priority=3&filter-status=0</a> ) but if Google can live with it maybe we too <img class="emoji" title=":dancers:" alt=":dancers:" src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f46f.png" height="20" width="20" align="absmiddle"> If we go for this I suggest to change the name of the vars to remove <code>filter-</code></p> <p>So what do you think is the best solution?</p> <p>I think the GET forms is the more practical solution.</p> |
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-07-13 16:11:41 |
I think that GET is the very good option, but thinking about personal filters may be we should hold on option 1?