PDA

View Full Version : Search box code messing with Tag code on SHOWTHREAD


jw0ollard
Tue 29th Apr '08, 8:55pm
I'm not posting this as a bug report for a few reasons...

The first thing I always do when I restyle vBulletin is make the search box VISIBLE on the actual page. I find it completely counter-intuitive to hide a search box.

So I moved the search popup code (the form code only) for the search box next to the Reply button at the top of the page, and now I can't Add/Remove/Edit tags anymore.

I've looked at the code and I'm very confused by this. The ONLY thing I've done is move the code's position. This is ALL default vBulletin SHOWTHREAD code (for now).

So why is this: <form action="search.php?do=process&amp;searchthreadid=$threadid" method="post">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">$vbphrase[search_this_thread]<a name="goto_threadsearch"></a></td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="hidden" name="do" value="process" />
<input type="hidden" name="searchthreadid" value="$threadid" />
<input type="text" class="bginput" name="query" size="25" />$gobutton<br />
</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="search.php?$session[sessionurl]searchthreadid=$threadid">$vbphrase[advanced_search]</a></td>
</tr>
</table>
</form>Not agreeing with the Tags code when it's above it on the page?

I'm getting a new page that says "Invalid Action Specified" when I Edit/Add/Remove a tag.

----

I've tried looking at the tags JS, but it's so minified it's impossible. I'll be downloading the source JS soon, I guess, to troubleshoot.

----

To clarify, I've also removed the JS for the popup, and removed the TD in the toolbar with the search link. The page validates as well. No duplicate IDs or anything.

jw0ollard
Tue 29th Apr '08, 11:34pm
Well apparently you can't move the tag code anywhere else on the page either.

If you move it BELOW where the hidden popup code is, it gives you an error. If you move it ABOVE everything else in the body, it says there are "No posts to apply the tags to".

I didn't know the tags system would be so volatile. It's quite disappointing to be honest.

I know you don't support modifications to the templates, but to entirely disallow changing the position of the Tag box is pretty cruel. I doubt this will get any attention as a thread, so now that I've also found out that you can't even MOVE the tag box, I'll try submitting it as a bug.

The JS and everything should have been properly coded to allow the Tag box to exist anywhere on the page.

Jake Bunce
Wed 30th Apr '08, 12:54am
That sounds like a problem of overlapping HTML forms. Forms don't nest. If you put one form (e.g. the search box) inside of another form (e.g. inline moderation) then the form won't submit correctly. For example:

Good:


<form ...>

</form>

<form ...>

</form>


Bad:


<form ...>

<form ...>

</form>

</form>

jw0ollard
Wed 30th Apr '08, 1:30am
Sorry, I must have forgot to mention I made sure I wasn't nesting forms. I took the search form code and simply moved it, intact. It started with <form> and ended with </form> but no matter what, if the search form is above the tags in the code, the tags interface will no longer work.

I can take the search form, put it directly below the Tags box and everything will be fine. The second I move it above the Tags box it just won't work anymore.

Anyway, I'll double check.. But even if I was nesting the search form accidentally how would that affect the Tags box? I'm not moving the tags box at all.

----

But then also, the search was working, so it couldn't have been inside another form, or I'd get some kind of error... *sigh* I'll go and double check.

Jake Bunce
Wed 30th Apr '08, 2:01am
I don't know exactly why the tags weren't working, but it was apparently related to your template changes. My last post is just a likely explanation based on my experience with these problems.

oldengine
Fri 16th May '08, 10:52am
I reverted my SHOWTHREAD template and I still get "Invalid Action Specified" when trying to edit a tag. Are there any other templates involved?

Edit: It was a mod for an ad insertion in my postbit template. I am now using the new template ad_showthread_firstpost instead of modding my postbit. Hey, we need more of these new ad insertion locations! They're great!