Rev 165: still Javascript errors; working on table view but displaying nothing

Status
Not open for further replies.

Roland

Member
Hi Rob,

there are still Javascript errors:
Administrator: "edit table" form on opening the page.
Line: 1414
sign: 4
error: object not supported

In the frontend diplaying any edit or view only form:
Line: 14
Pos: 5
error: element.id is Null or not an object

Diplaying joined tables:
I have real big problems with joined tables (Bücher and Rezensionen). I don't get an error displayed when I try to open the table view. IE or Firefox are working and working but nothing happens. The status bar loads but I don't get a result.
After this action I can't open any of my fabrik tables in the frontend view. I even can't open my phpMyAdmin afterwards. It' salo loading without displaying the view.
I have to log out, clear alle caches and login once again.
When I am logged in as adminstrator I get the same result: I can't save or apply changes to my joined tables.
If I cancel the action - I get logged out automaticly.

If you want to see the effect: http://www.oldenbourg.de/verlag/gwz
I set the tables to view access for public. Try to view "Bücher" and "Rezensionen".

Roland
 
Re: Rev 165: still Javascript errors; working on table view but displaying nothi

I'm seeing both pages OK (Buchen and Rezensionen), in both IE7 and FF2, although there is a JS error. IE7 gives me some useless generic message, but FireBug says:

$('checkAll').addEvent is not a function

Which I think is because in the template.php, the checkAll checkbox is only created if the user has canDelete privs, BUT the event is being added regardless. So if the user doesn't have canDelete, the addEvent function is being called on an ID that doesn't exist.

Code:
<?php }
if( $this->canDelete ){?>
<label><input type="checkbox" id="checkAll" />Check All</label>
<?php 
}
print_r($this->hiddenFields);?>
<?php echo $this->nav;
echo $this->deleteButton;
?>
</form>

<script type="text/javascript">
	$('checkAll').addEvent( 'change', function(e){
		var chkBoxes = document.getElementsByName('ids[]');
		if(!$('checkAll').checked){
			var c = '';
		}else{
			var c = 'checked';
		}
		for(var i=0;i<chkBoxes.length;i++){
			chkBoxes[i].checked=c;
		}
		var event = new Event(e);
	 	event.stop();
	});
</script>

I suspect if the addEvent sciptsicle were moved inside the canDelete conditional, the error might go away. But a) this shouldn't exhibit itself when you are logged in as Administrator, and b) I'm not quite sure what this would have to do with the really bizarre problems you describe.

FYI, I am unable to replicate either of the first JS errors you described. I on Rev 165, using the same versions of FF and IE as you. I can edit tables on the backend and view/edit forms on the front end, and don't get the JS errors you describe. Have you cleared your browsers cache as well as the server?

What I do get is three repeated errors in mootools.js, complaining about item.push. I'm not even going to try and debug that one! Mootools scares me at the best of times, and this seems to be a packed version to boot.

-- hugh
 
Good morning Hugh,

thank you for testing.
I don't know why the table work now in my online system. The delopment system still failes. O.k. I will be back if I can can give details.
I did not mean to say that the javascript errors have to do with this problem. It was just a list of subjects.

Subject Javascript errors:

I will check the thing about $('checkAll').addEvent

Yes - of course - I deleted all caches. You can see the Javascript error on VIEW or EDIT in the table.
You have access to view a record here: http://www.oldenbourg.de/verlag/gwz/index.php?option=com_fabrik&Itemid=54
I checked with two browsers.

It displays the Javascript error IE:
Line: 14
Pos: 5
error: element.id is Null or not an object

FF2 says:
error: oEl.element has no properties
file: http://www.oldenbourg.de/verlag/gwz/components/com_fabrik/views/form/form.js
line: 13

Roland
 
Re: Rev 165: still Javascript errors; working on table view but displaying nothi

I don't know if my problem is related but...

When I try to edit a table now in 1.0.4b I lose all joomla formatting css and I get this error in the "Data" tab under the first varAdminFilters line:

Fatal error: Call to undefined function: htmlspecialchars_decode() in /home/lebermac/public_html/administrator/components/com_fabrik/views/table/tmpl/default.php on line 1065

I'll post an image if that'll help. All of the usual Joomla! Admin backend css and styles is gone.
Here's the image link
 
Hi,

this problem is not what I have been talking about. I meant a JAVASCRIPT error.

But I had your problem too. I solved it by downloading all new SVN for administrator and frontend.
I am not sure but maybe it's because the styles are located in new directories since a while ...

Roland
 
Re: Rev 165: still Javascript errors; working on table view but displaying nothi

LeberMac said:
Fatal error: Call to undefined function: htmlspecialchars_decode() in /home/lebermac/public_html/administrator/components/com_fabrik/views/table/tmpl/default.php on line 1065

Sounds like you are running PHP4. The htmlspecialchars_decode() function was added in PHP 5.1.0. I believe Rob has provided backward compat for the htmlspecialchars* functions in the more recent CVS versions. But I'd still recommend upgrading to PHP5, as PHP4 is being end-of-lifed this year (www.php.net).

-- hugh
 
Re: Rev 165: still Javascript errors; working on table view but displaying nothi

Hugh Messenger said:
I'm seeing both pages OK (Buchen and Rezensionen), in both IE7 and FF2, although there is a JS error. IE7 gives me some useless generic message, but FireBug says:

$('checkAll').addEvent is not a function

I've added in a test to ensure the event is only added if the checkAll checkbox exists

are you still getting the push errors?
 
Hi Rob,

I updated to SVN 171.

The link http://www.oldenbourg.de/verlag/gwz/index.php?option=com_fabrik&Itemid=54 doesn't show the Javascript
error $('checkAll').addEvent is not a function
anymore.

I changed the view only template to "default" to avoid possible errors ov my template.
If you click on "View" to view any of the records you'll get the Javascript error I described before:

It displays the Javascript error IE 7:
Line: 14
Pos: 5
error: element.id is Null or not an object


Firefox 2.0.6 says:
error: oEl.element has no properties
file: http://www.oldenbourg.de/verlag/gwz/components/com_fabrik/views/form/form.js
line: 13


If you try to add a record on the left top "Datensatz hinzufügen" you get the php error message:
Fatal error: Allowed memory size of 26214400 bytes exhausted (tried to allocate 128 bytes) in /home/www/html-data/verlag/gwz/includes/database.php on line 489

Roland
 
Re: Rev 165: still Javascript errors; working on table view but displaying nothi

Rob Clayburn said:
are you still getting the push errors?

Yes, but only on one of the two sites I have running the latest rev. I was just in the process of posting a new thread about that.

-- hugh
 
Re: Rev 165: still Javascript errors; working on table view but displaying nothi

Hi Roland

It seems that your file /components/com_fabrik/views/form/form.js hasn't been updated to the latest version.

Code:
addElement: function( oEl ){
  elId = oEl.element.id.replace('[]', '');
  this.elements.set(elId, oEl);
},

should look like this:

Code:
addElement: function( oEl ){
  if(oEl.element){
    elId = oEl.element.id.replace('[]', '');
	this.elements.set(elId, oEl);
  }
},

For the fatal error you will need increase your php memory limit in your php.ini file.
 
Javascript error solved in SVN 155

Good Morning Rob,

I am sorry - it seems that I missed the revision 155 of this Javascript file.
The error is corrected.

Thank you.
Roland
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top