Strange ERROR MESSAGE when editing tags ...
Hi again.
When we first tested some videos to make sure that everything was working, we didn't bother to write a bunch of tags. Instead, we just typed stuff like lkjlo and hgfzfztfu or öllöklökl (just random keys) to save time. Later on we deleted those videos through the admin panel, but the tags remained. When we went to the tags section in the admin panel, we attempted to edit them by clicking on the button that's next to each tag, and received this error:
Code:
ERROR: Unable to execute query
UPDATE `tags` SET active=and active = 1 WHERE id=9
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and active = 1 WHERE id=9' at line 1
The error appears on every tag, just the ID number changes. Any idea how to get rid of that or what's causing the error? We'd like to have the ability to edit those tags.
Thank you.
Re: Strange ERROR MESSAGE when editing tags ...
please check your tpl file
this is correct code
Quote:
{section name=tag loop=$tags}
<tr class="{cycle values="tablerow1,tablerow2"}">
<td>{$tags[tag].id}</td>
<td>{$tags[tag].tag}</td>
<td>
<form method="POST" action="">
<input type="hidden" name="action_tag" value="{$tags[tag].id}">
{if $tags[tag].active eq 1}
<input type="submit" name="action" value="Disable">
{else if $tags[tag].active eq 0}
<input type="submit" name="action" value="Activate">
{/if}
</form>
Re: Strange ERROR MESSAGE when editing tags ...
Thanks, but that (below) is exactly what I have ... The only thing that I've done, was to translate the words in the values from disable and activate to their equivalent in german. But everything else is exactly the same ... ??? :?
Code:
{section name=tag loop=$tags}
<tr class="{cycle values="tablerow1,tablerow2"}">
<td>{$tags[tag].id}</td>
<td>{$tags[tag].tag}</td>
<td>
<form method="POST" action="">
<input type="hidden" name="action_tag" value="{$tags[tag].id}">
{if $tags[tag].active eq 1}
<input type="submit" name="action" value="Deaktiviert">
{else if $tags[tag].active eq 0}
<input type="submit" name="action" value="Aktiviert">
{/if}
</form>
</td>
</tr>
{/section}
Re: Strange ERROR MESSAGE when editing tags ...
{if $tags[tag].active eq 1}
<input type="submit" name="action" value="Deaktiviert">
{else if $tags[tag].active eq 0}
<input type="submit" name="action" value="Aktiviert">
{/if}
this code is misteken please replace below this
Code:
{if $tags[tag].active eq 1}
<input type="submit" name="action" value="Disable">
{else if $tags[tag].active eq 0}
<input type="submit" name="action" value="Activate">
{/if}
Re: Strange ERROR MESSAGE when editing tags ...
.
Thank you ... but that's really crazy ...
I thought that the button text in form values can be changed & translated without a problem? Is it like that in all of the admin .tpl files, or is it just this file that won't permit for the button text to be renamed? Thanks again, that did it though.
Re: Strange ERROR MESSAGE when editing tags ...
You are probably going to run into similar problems on any button that does an action. As in this case, the button does an enable or a disable. Because the button performs an action, the PHP code is specifically looking for the words "enable" and "disable" for it to do anything. Changing it will break the action.