Recent Topics

[4.1.2] Error in js when changing visibility of posts

Started by on Nov 14, 2011 – Contents updated: Nov 14, 2011

Nov 14, 2011 23:46    

Hi
when changing the visibility radio button I get the error message below. This is a message delivered by MSIE8 for an error occuring in a javascript. Sorry it's in french.
regards.
Jacques

Code

Détails de l’erreur de la page Web
 
Agent utilisateur : Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C)
Horodateur : Mon, 14 Nov 2011 22:38:33 UTC
 
Message : Exception levée mais non décelée
Ligne : 17
Caractère : 12370
Code : 0
URI : http://www.le-fataliste.fr/blabla/rsc/js/jquery.min.js?v=4.1.2
 
Message : Cet objet ne gère pas cette propriété ou cette méthode
Ligne : 985
Caractère : 4
Code : 0
URI : http://www.le-fataliste.fr/blabla/admin.php?ctrl=items&action=edit&p=202&redirect_to=%2Fblabla%2Fadmin.php%3Fblog%3D1%26show_statuses%255B%255D%3Ddraft%26orderby%3Ddatemodified%26comments%3D5%26show_past%3D1%26show_future%3D1%26posts%3D5%23item_202
 
 
Message : Exception levée mais non décelée
Ligne : 17
Caractère : 12370
Code : 0
URI : http://www.le-fataliste.fr/blabla/rsc/js/jquery.min.js?v=4.1.2

Mar 02, 2012 07:08

It might be related to jQuery or your particular browser. Anyway, jQuery was updated in v5 and hopefully the bug is fixed.

I can't reproduce it in test system.

Mar 02, 2012 12:31

sam2kb wrote:

It might be related to jQuery or your particular browser. Anyway, jQuery was updated in v5 and hopefully the bug is fixed.
I can't reproduce it in test system.

Thanks for the answer.
I have this with b2evo v 4.1.2
The previous error message was with MSIE8 / win XP32. With Mozilla Firefox v3.6x or v10 / win XP 32, i have the following error in the console :
"Erreur : uncaught exception: Syntax error, unrecognized expression: [name=actionArray[update_publish]]"

Should i look for this new jquery version ? If so, where should i put it ?
regards
Jacques

Mar 02, 2012 19:07

sam2kb wrote:

Replace /rsc/js/jquery.js and /rsc/js/jquery.min.js with new files from here. Just make sure you remove version number from filename.

http://code.jquery.com/jquery-1.7.1.min.js
http://code.jquery.com/jquery-1.7.1.js

Ok, I tried, but no change...

I possibly localized the error there (in admin.php when editing a post, at the end of the file) :

Code

<script type="text/javascript">
jQuery( '#itemform_visibility input[type=radio]' ).click(  function()
{
  var publishnow_btn = jQuery( '.edit_actions input[name=actionArray[update_publish]]' );
 
  if( this.value != 'draft' )
  {  // Hide the "Publish NOW !" button:
    publishnow_btn.css( 'display', 'none' );
  }
  else
  {  // Show the button:
    publishnow_btn.css( 'display', 'inline' );
  }
} );
</script>

I hope you can find it ?
regards
Jacques

Mar 02, 2012 19:23

The code looks ok. I don't get errors in my IE9 or FF10 on windows 7. I will check other browsers and OS.

Mar 03, 2012 20:41

sam2kb wrote:

The code looks ok. I don't get errors in my IE9 or FF10 on windows 7. I will check other browsers and OS.

The code portion over there is apparently a call to some part of jquery.
I checked in Win 7 with MSIE 9 or FF and I DO have the same error. Of course to receive notification of the error, in IE you need to validate the options in tools/options/advanced. In FF there are in the error console. Could it be that something could differ according to the localisation for this question ? My IE or FF are in french.

Mar 07, 2012 18:47

Hello,

sorry to bring back this topic here, but it has abusively been moved to "fixed". It is not !

The fact : in 4.1.2 and 4.1.3 when one wants to changed the status of a post from, say, private to published, then an error is raised by js and the action of unhiding the "publish" button is not done. However, when
recording the post, everything is Ok.

We already discussed here about my version of browser, of system and of jquery, without result. I just noticed that another blog running v 4.0.5 of b2evol has not this problem. So, since it is exactly with the same environment my conclusion is that the error is somewhere within the changes since 4.0.5, not in any part of my environment ?

Of course, since the post is anyhow recorded, one can live with this error, but I do ot like this. With MSIE this kind of js error is not shown by default, one has to go to the tools/advanced settings to see them. In FF they are in the error console.

Here is the code where the problem lies.

Code

<script type="text/javascript">
jQuery( '#itemform_visibility input[type=radio]' ).click(   function()
{
   var publishnow_btn = jQuery( '.edit_actions input[name=actionArray[update_publish]]' );
 
   if( this.value != 'draft' )
   {   // Hide the "Publish NOW !" button:
      publishnow_btn.css( 'display', 'none' );
   }
   else
   {   // Show the button:
      publishnow_btn.css( 'display', 'inline' );
   }
} );
</script>

regards,
Jacques

Mar 28, 2012 04:23

I finally found where the bug was. We need to enclose actionArray[update_publish] in double quotes.

Code

var publishnow_btn = jQuery( '.edit_actions input[name="actionArray[<?php echo $next_action; ?>_publish]"]' );

Thank you for your patience :)

Fixed in 4.1.4

Mar 28, 2012 14:00

sam2kb wrote:

I finally found where the bug was. We need to enclose actionArray[update_publish] in double quotes.

Code

var publishnow_btn = jQuery( '.edit_actions input[name="actionArray[<?php echo $next_action; ?>_publish]"]' );

Thank you for your patience :)
Fixed in 4.1.4

Ok. Great ! Can you please tell me where to localize the file to be edited ?
Thanks for your good job :)
Best regards.
--
Jacques

Mar 28, 2012 20:43

The code is in /inc/items/model/_item.funcs.php search for

Code

input[name=actionArray
there are 2 appearances, you should edit both.

Mar 28, 2012 21:09

sam2kb wrote:

The code is in /inc/items/model/_item.funcs.php search for

Code

input[name=actionArray
there are 2 appearances, you should edit both.

Ok, I confirm. This solves the problem. Thanks a lot.
best regards.
Jacques


Form is loading...

b2evo – This forum is powered by b2evolution CMS, a complete engine for your website.