Skip to content

Instantly share code, notes, and snippets.

@therealplato
Created May 3, 2012 15:54
Show Gist options
  • Save therealplato/2586750 to your computer and use it in GitHub Desktop.
Save therealplato/2586750 to your computer and use it in GitHub Desktop.
JReviews user form creation problem
I'm debugging a Joomla site that uses JReviews to store user reviews. The JReviews code has apparently been modified into a broken state.\
User forms are not being saved to the database when the user clicks Submit at the bottom of the form. I'm not sure if the server is receiving the data.
I'm using JReviews 2.3.12.203 and PHP 1.5. Unfortunately I'm running on godaddy hosting so I don't have access to php console error logs.
Details:
The form appears to be generated by /components/com_jreviews/jreviews/controllers/reviews_controller.php.
The generated html looks like:
<form id="jr_review0Form" action="http://cuizini.com/dev5/dev/?format=raw&amp;tmpl=component" target="review_submit_iframe" enctype="multipart/form-data" method="post" class="jr_form jr_formContainer jr_hidden" style="display: block; ">
The form contains some fields:
<input type="text" name="data[Review][title]" id="title" value="" class="jrTitle" size="50" maxlength="100">
There's a submit button at the bottom, whose html looks like this:
<button class="jrButton" id="jr_submitButton" onclick="jreviews.review.submit(this);">Submit</button>
jreviews.review.submit = function (element) {
//jQuery(element).s2SubmitForm();
jQuery(element).submit();
}
I'm unfamiliar with jquery but their documentation says that you call .submit() on a button that has type="submit"; is this part of the problem?
Also I can't find much information about what this s2framework. It seems to be used to let the server communicate with the client through AJAX, and presumably the server is supposed to save the new review information in the database when it comes through the AJAX pipe?
Any information you can provide regarding the flow of data from the user's review form to the JReviews database would be helpful.
Thanks!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment