Follow us on Twitter
Welcome, Guest Create an account
Username Password:
JoomAce Support
AcePolls
General Support
Solved Issues
  • Page:
  • 1
  • 2

TOPIC: After vote it keeps saying processing

3 weeks, 4 days ago #23415

After vote it keeps saying processing

After a vote is given, it just keeps saying processing, it never ends.
It has registered the vote, and if you reload the page it will show the correct vote given.
  • K F
  • Non-Customer
  • Posts: 7
OFFLINE
The topic has been locked.
3 weeks, 1 day ago #23463

Re: After vote it keeps saying processing

Versions are J1.7, AcePolls 1.07 component, module 1.0.0
  • K F
  • Non-Customer
  • Posts: 7
OFFLINE
The topic has been locked.
1 week, 5 days ago #23801

Re: After vote it keeps saying processing

Turn on AcePolls AJAX Support,
Vote in Polls and waiting for a log time for processing..

How to use it with AJAX in normal mode?



Joomla 1.7
AcePolls 1.7.0
  • Black Moon
  • Non-Customer
  • Posts: 5
Last Edit: 1 week, 5 days ago by Ahmet.
OFFLINE
The topic has been locked.
1 week, 4 days ago #23829

Re: After vote it keeps saying processing

For me is the same issue!!! and is a great trouble for us cause we've severals polls..

Any fix to this issue??

thanks a lot

Joomla 1.6.6

Acepolls 1.0.7
  • finitol
  • Non-Customer
  • Posts: 2
Last Edit: 1 week, 4 days ago by finitol.
OFFLINE
The topic has been locked.
1 day, 12 hours ago #24033

Re: After vote it keeps saying processing

that's why cause

1. joomla 1.7 mootools 1.2;
2. JSimpleXMLElement class declared deprecated;



solved
  • Black Moon
  • Non-Customer
  • Posts: 5
OFFLINE
The topic has been locked.
1 day, 7 hours ago #24037

Re: After vote it keeps saying processing

Black Moon, how did you solved it?? i'm not enough skill to solved myself, so i need help

thanks a lot
  • finitol
  • Non-Customer
  • Posts: 2
OFFLINE
The topic has been locked.
1 day, 5 hours ago #24040

Re: After vote it keeps saying processing

Black Moon wrote:
that's why cause
1. joomla 1.7 mootools 1.2;
2. JSimpleXMLElement class declared deprecated;
solved

Could you elaborate a bit on this?
  • K F
  • Non-Customer
  • Posts: 7
OFFLINE
The topic has been locked.
1 day, 5 hours ago #24042

Re: After vote it keeps saying processing

now i'm online by phone. in the morning from note u all get the description
  • Black Moon
  • Non-Customer
  • Posts: 5
OFFLINE
The topic has been locked.
1 day, 4 hours ago #24044

Re: After vote it keeps saying processing

Thanks, looking forward to see it :-)
  • K F
  • Non-Customer
  • Posts: 7
OFFLINE
The topic has been locked.
17 hours, 33 minutes ago #24068

Re: After vote it keeps saying processing

1. why i choose acepolls?
- in joomla 1.5 was standart poll component/module but in j1.7 it dissapears.
I'm writing portal for 3d models, programs and sometimes i need to make different polls on such topics.

So simple poll module is needed with options and ajax support (cause i don't want to make new whole request for single vote/poll). There's also niceajaxpoll module, but it's more complex and bugable (i suppose).

2. When u turn on acepolls ajax support javascript code sends and waits request from server.
Here was a bug (Code shows a div with loading icon - and waits for no reply...)

here's original code
/* id."').addEvent('submit', function(e) {
				// Prevent the submit event
			    new Event(e).stop();
				var options = $('poll_vote_".$poll->id."').getElements('input[name=voteid]');
				var nothing_selected = 1;
				options.each(function(item, index){
					if(item.checked==1) {nothing_selected = 0;}
				});
				if (nothing_selected) {
					alert('".JText::_('Please select an option')."');
					return false;
				} else {
						$('submit_vote_".$poll->id."').disabled = 1;
						$('poll_loading_".$poll->id."').setStyle('display','');
						// Update the page
						this.send({
						onComplete: function(response, responseXML)
						{
							// get the XML nodes
							var root   = responseXML.documentElement;
							var options   = root.getElementsByTagName('option');
							var text   = root.getElementsByTagName('text');
							//var percentages  = root.getElementsByTagName('percentages');
							var voters   = root.getElementsByTagName('voters');
							// prepare the XHTML
							var updateValue = '".$updateValue."';
							// update the page element 'update'
							//$('polldiv_".$poll->id."').removeClass('ajax-loading');
							$('polldiv_".$poll->id."').empty().setHTML(updateValue);
                            var pollSlide = new Fx.Slide('poll_comp_form');
                        	pollSlide.slideOut();
						}});
				}
        });
    });/* ]]> */";



code stops on the line

this.send({
onComplete: function(response, responseXML)

Ajax model on the poll waits for request in XML format.

This code was workable with mootools 1.1. In J1.7 mootools 1.2 is ised (maybe higher).

So u need to transform this line with
this.set('send', {
onComplete: function(response, responseXML).send()


Now - enters into this function. (You can see it throw debugging console)

But there's no request from server side.
I only got something like this
23:35:25.879] POST gid360.ru/%5Bobject%20Object%5D [HTTP/1.1
404 Not Found 2мс]



So go to server-side and try to understand why there's no answer.
Go to com_acepolls/views/poll/view.raw.php

function display($tpl = null) {
		// Get data from the model
		require_once(JPATH_COMPONENT.DS.'models'.DS.'ajaxvote.php');
		$model = new AcepollsModelAjaxvote();
		$vote		=  $model->getVoted();
		$data		=  $model->getData();
		$total		=  $model->getTotal();
		//print_r($data); exit;
		$poll_id = JRequest::getVar('id', 0, 'POST', 'int');
		// create root node
		$xml = new JSimpleXMLElement('poll', array('id' => $poll_id));
		//get total votes
		$sum = 0;
		foreach ($data as $row) {
			$sum += $row->votes;
		}
		$number_voters = 0;
		$options =& $xml->addChild('options');
		for ($i=0; $iaddChild('option', array('id'=>$data[$i]->id, 'percentage' => self::_toPercent($data[$i]->votes, $sum), 'votes'=>$data[$i]->votes, 'color'=>$data[$i]->color));
			$text =& $option->addChild('text');
			$text->setData($data[$i]->text);
			$number_voters += $data[$i]->votes;
		}
		$voters =& $xml->addChild('voters');
		$voters->setData($number_voters);
		$this->assign('xml', $xml->toString());
		$this->setLayout('raw');
		parent::display($tpl);
	}


In this line
$xml = new JSimpleXMLElement

code execution stops.
Through debugging I got something like this
class not found
.
The reason is
officially commited the change a few minutes ago and marked the
classes JSimpleXML and JSimpleXMLElement as deprecated


I changed JSimpleXMLElement to JXMLElement and few line in xlm creation code
function display($tpl = null) {
		// Get data from the model
		require_once(JPATH_COMPONENT.DS.'models'.DS.'ajaxvote.php');
		$model = new AcepollsModelAjaxvote();
		$vote		=  $model->getVoted();
		$data		=  $model->getData();
		$total		=  $model->getTotal();
		//print_r($data); exit;
		$poll_id = JRequest::getVar('id', 0, 'POST', 'int');
		// create root node
		$xml = new JXMLElement('');
		$xml->addAttribute('id', $poll_id);
                //get total votes
		$sum = 0;
		foreach ($data as $row)
                {
			$sum += $row->votes;
		}
		$number_voters = 0;
		$options =& $xml->addChild('options');
		for ($i=0; $iaddChild('option');
			$option->addAttribute('id', $data[$i]->id);
                        $option->addAttribute('percentage', self::_toPercent($data[$i]->votes, $sum));
                        $option->addAttribute('color', $data[$i]->color);
                        $option->addChild('text', $data[$i]->text);
			$number_voters += $data[$i]->votes;
		}
		$xml->addChild('voters', $number_voters);
		$this->assign('xml', $xml->asFormattedXML());
		$this->setLayout('raw');
		parent::display($tpl);
	}


Now all sides working. AJAX sends and gets responses, server echos answer.
In attachment there are 2 modified files (com_acepolls/views/poll/view.raw.php and mod_acepolls/tmpl/default.php)



p.s. a little bit more
1. I don't need to show pollbars in the voting result, so a added var $show_bars = 0. If u want to use bars just comment line with $show_bars or set $show_bars=1 (file - mod_acepolls/mod_acepolls.php)

2. You can change Fx.slide effect in javascript. I set horizontal (default was vertical). To set vertical just change

var sl = new Fx.Slide('polldiv_1', {mode: 'horizontal'}).hide();
to
new Fx.Slide('polldiv_1')

(polldiv_1 - div with poll form)
If there's no need in slider - remove lines with slider.

This attachment is hidden for guests. Please log in or register to see it.
  • Black Moon
  • Non-Customer
  • Posts: 5
Last Edit: 16 hours, 46 minutes ago by Black Moon.
OFFLINE
The topic has been locked.
  • Page:
  • 1
  • 2
JoomAce Support
AcePolls
General Support
Solved Issues
Powered by Kunena
Time to create page: 0.21 seconds