We are using the Community Quest Maker module along with the Quest Maker module. We are experiencing a strange issue. IF we create a quest for one of our new items that has a space in the name we are unable to complete the quest. If we go into the object and either put an underscore where the space is or remove it making the name just one word (Cheese Burger becomes either Cheese_Burger or CheeseBurger) then the quest can be completed.
Anyone have any thoughts on this one?
Quest Maker module small issue
Re: Quest Maker module small issue
Hmmmm... I never tested that part out before. Ok, I'll check on it!
- KyleMassacre
- Posts: 573
- Joined: Wed Nov 27, 2013 12:42 pm
Re: Quest Maker module small issue
This is rather odd. I can't think of a reason why an object name would cause the module to crash. Are you getting any kind of error? And my questions for you Kal is: how are you storing the item that you are requesting as the quest creator? Are they stored as the object id or the object name? Also, are you utilizing the Item's class? Because the only thing I can think of is if your not using the Item class and you are storing the object name instead of the object id, you may be getting a failed query. If you are getting the information from the database via the Execute/Load* methods, you may need to change your query to use the LIKE SQL keyword:
I myself would stay away from that method though and just use the Item class.
Another thing is that I am not sure if you are using the Ajax lib. If you are you may not see an error when a function is ran due to the fact it works off of JS so you may want to open your developer tools and see if there is some sort of exception thrown.
These are basically the only ideas that I have since I don't own the module.
If you two can't figure it out either you Kal can send me the module and I can take a look or cbsarge, if your game is live I can swing in on an administrator account and take a look at the module for you and share my findings with Kal to get this patched.
Code: Select all
$obj = $db->Execute("select id from objects where name like %$name%");
Another thing is that I am not sure if you are using the Ajax lib. If you are you may not see an error when a function is ran due to the fact it works off of JS so you may want to open your developer tools and see if there is some sort of exception thrown.
These are basically the only ideas that I have since I don't own the module.
If you two can't figure it out either you Kal can send me the module and I can take a look or cbsarge, if your game is live I can swing in on an administrator account and take a look at the module for you and share my findings with Kal to get this patched.
Re: Quest Maker module small issue
ok i fixed it!
BEFORE:
AFTER:
CHANGES:
single quotes on '$item_name' for line 15
change '$item_name' to '$user' for line 33
change [$item_name] to [$user] for line 40
it was just single quote i'm missing that's it. LOL
thanks for finding the error!
i'll send a new update with the new patch.
EDITED: These lines are in the Community's Quest module.
BEFORE:
Code: Select all
line 15 = echo "<form method='post' name=$item_name>";
line 33 = echo "<input type='hidden' value='ok' name=$item_name>";
line 40 = if (isset($_POST[$item_name]))
Code: Select all
line 15 = echo "<form method='post' name='$item_name'>";
line 33 =echo "<input type='hidden' value='ok' name='$user'>";
line 40 = if (isset($_POST[$user]))
single quotes on '$item_name' for line 15
change '$item_name' to '$user' for line 33
change [$item_name] to [$user] for line 40
it was just single quote i'm missing that's it. LOL
thanks for finding the error!
i'll send a new update with the new patch.
EDITED: These lines are in the Community's Quest module.
Re: Quest Maker module small issue
Even after the edits I'm still receiving an error when trying to complete the quest.
Code: Select all
Uncaught TypeError: Cannot read property 'submit' of undefined
Re: Quest Maker module small issue
If I look at the rendered page it's not resolving the $item_name variable for the submit portion of the form. It's just coming up as:
but the hidden part of the form is resolving the variable and showing:
Code: Select all
<a href="#" onclick="document.forms['item_name'].submit();return false;" id="btn_i_have_the_item" class="linkButton">I have the item</a>
Code: Select all
<input type="hidden" value="ok" name="CheeseBurger">
Re: Quest Maker module small issue
Copy this and replace it on top of the old one:
Code: Select all
while(!$result->EOF)
{
$item = $result->fields[3]."<br>";
$b = $db->Execute("select name from objects where id = ?", $item);
$item_name = $b->fields[0];
$field = $result->fields[0];
echo "<form method='post' name='$item_name'>";
$name = strip_tags($result->fields[1])."<br>";
$user = $result->fields[2]."<br>";
$quest =strip_tags($result->fields[4])."<br>";
$wage = $result->fields[5];
$b = $db->Execute("select name from objects where id = ?", $item);
$item_name = $b->fields[0];
global $item_name;
$result->MoveNext();
echo "<b>$name</b>";
echo $quest;
$b = $db->Execute("select name from objects where id = ?", $item);
$item_name = $b->fields[0];
echo "Look for item:<b>$item_name</b>";
echo "<br/>";
echo "I'm willing to pay<b>\n<span style='color:#8A4B08'>$wage Gold</></b>";
echo "<input type='hidden' value='ok' name='$user'>";
echo "<br/>";
SubmitButton("I have the item","$item_name");
echo "<br/>";
echo "<br/>";
echo "</form>";