ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: Jorin on June 24, 2018, 08:12:31 am

Title: [1.1.3] merge more then one topic
Post by: Jorin on June 24, 2018, 08:12:31 am
I tried to merge four topics today. I got the following error. After clicking on "back" ("Zurück") I got a session timeout message, but I was still logged in.

Merging two topics makes no problems.
Title: Re: [1.1.3] merge more then one topic
Post by: ahrasis on June 24, 2018, 09:07:18 am
It says you can only do two topics at a time and you do more than that, so I will not consider this as a bug but more on feature upgrade. Basically you want to be able to merge more topics than the default.

Current solution will be to do it two topics on each merge, until you merge them all. I count that as three times.
Title: Re: [1.1.3] merge more then one topic
Post by: Jorin on June 24, 2018, 10:34:30 am
Quote from: ahrasis – It says you can only do two topics at a time...

It does? Where? Oh, you mean the error message itself? If that's the limit, then it is not a bug, you are right. There should be a note about that somewhere.
Title: Re: [1.1.3] merge more then one topic
Post by: tino on June 24, 2018, 10:38:45 am
On the top of the merge it says

"This function will merge the messages of two topics into one topic. The messages will be sorted according to the time of posting. Therefore the earliest posted message will be the first message of the merged topic. "

The bug is allowing you to select more than two.
Title: Re: [1.1.3] merge more then one topic
Post by: Spuds on June 24, 2018, 10:53:22 am
head scratch .... I think It should allow you to merge more than one at a time.

So we may need to update that line of text so its actually correct :P

Although the bug is showing up in merge topics, I think its a bit more general of an issue, albeit very rare in the code.  ElkArte uses a centralized post and validation class to interact and validate form data.  I'd start with this edit to the HttpReq.class.php in sources and see how that goes.

Code: (find) [Select]
		// To the validator
$this->_dataValidator->validation_rules(array());
$this->_dataValidator->sanitation_rules(array($name => $sanitize));
$this->_dataValidator->validate($this->_param);

Code: (replace) [Select]
		// To the validator
$this->_dataValidator->validation_rules(array());
$this->_dataValidator->sanitation_rules(array($name => $sanitize));

if (is_array($this->_param[$name]))
$this->_dataValidator->input_processing(array($name => 'array'));

$this->_dataValidator->validate($this->_param);

That scripturl issue in the image looks to be your theme issue, I don't see that in the default theme (your probably missing a global $scripturl; in your theme function. 

Not being able to press back is "normal" as you submitted a form, going back is not going to work since your are effectively trying to submit again.  The message could be better, but the result would be the same, denied !

I'll track this for 1.1.5 ETA: https://github.com/elkarte/Elkarte/issues/3216