Haloperidol / ljxp

Automatically exported from code.google.com/p/ljxp
0 stars 0 forks source link

Comments settings does not works #149

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create new WP post and crosspost it to LJ. Is settings window select 
"comments off"
2. Is LJ comments still avaliable
3.

What is the expected output? What do you see instead?

What version of the plugin are you using? What version of WordPress?
LJ_XP 2.2, WP 3.1

Please provide any additional information below.

Problem in missed variables names: in section that determinate comments 
settings used $comments variable, but in section that generate $args (for 
crosspost query) used $options['comments']

This patch may fix this issue by determinatig $options['comments'] base on 
$comments
{{{
--- lj-xp.php.orig      2011-10-09 15:14:35.000000000 +0400
+++ lj-xp.php   2011-10-09 15:13:16.000000000 +0400
@@ -52,7 +52,8 @@
        $comments = get_post_meta($post->ID, 'ljxp_comments', true);
        if (isset($comments) && $comments != 0) $options['comments'] = $comments;
                if ($options['comments'] == 2) $options['comments'] = 0;
-
+       $options['comments']=$comments;
+
        $options['userpic'] = get_post_meta($post->ID, 'ljxp_userpic', true);

        if (!is_array($options['skip_cats'])) $options['skip_cats'] = array();

}}}

Original issue reported on code.google.com by IATkache...@gmail.com on 9 Oct 2011 at 11:22

GoogleCodeExporter commented 8 years ago
Thanks! The fix is even simpler than that. :) It'll be in 2.3, which will be 
out later today or tomorrow.

Original comment by st...@sillybean.net on 9 Oct 2011 at 8:10

GoogleCodeExporter commented 8 years ago
Glad to hear it :) I have another path for security settings that does not work 
in 2.2.2. So i'll waiting for release 2.3 and after it i'll post this path here 
if it will be nessesary.

Original comment by IATkache...@gmail.com on 10 Oct 2011 at 7:37

GoogleCodeExporter commented 8 years ago
Not fixed in 2.3.1.
When in plugin settings LJ comments enabled, they are disabled in crossposted 
article on livejournal. When manually select "Comments enabled" when writing or 
editing the article, comments on livejournal in the crossposted article will be 
enabled.

Original comment by su...@hostenko.com on 12 Oct 2011 at 10:44

GoogleCodeExporter commented 8 years ago
Not fixed in 2.3.1.

Fix (+ $options['comments']=$comments;) does't works.

Original comment by lekseys on 19 Oct 2011 at 6:30

GoogleCodeExporter commented 8 years ago
I can't reproduce this all the time, which is weird, but I'm working on it.

Original comment by st...@sillybean.net on 21 Oct 2011 at 12:24

GoogleCodeExporter commented 8 years ago
Bug reprodused if default comments setings is "on" ($option['comments']=1) and 
not selected comments settings in post. For example.
This is because !0=1, but !1 not equal 0. At least on my version of PHP.
(((
# cat test.php
<?php
$test=0;
echo "test=$test, !test=".!$test."\n";
$test=1;
echo "test=$test, !test=".!$test."\n";
?>
# php test.php
test=0, !test=1
test=1, !test=
)))
Also if we don't select comment settings in post function  
get_post_meta($post->ID, 'ljxp_comments', true) return ""

This patch fix this issues
{{{
--- lj-xp.php.orig      2011-10-27 16:14:51.000000000 +0400
+++ lj-xp.php   2011-10-27 16:35:57.000000000 +0400
@@ -55,8 +55,8 @@
                }
        }
        $comments = get_post_meta($post->ID, 'ljxp_comments', true);
-       if (isset($comments)) $options['comments'] = $comments;
-               if ($options['comments'] == 2) $options['comments'] = 0;
+       if (isset($comments) && !empty($comments)) $options['comments'] = 
$comments;
+       if ($options['comments'] == 2) $options['comments'] = 0;
        $options['userpic'] = get_post_meta($post->ID, 'ljxp_userpic', true);

        if (!is_array($options['skip_cats'])) $options['skip_cats'] = array();
@@ -289,7 +289,7 @@
                                        'hour'                          => date('G', $date),
                                        'min'                           => date('i', $date),
                                        'props'                         => array(
-                                                                               
                'opt_nocomments'        => !$options['comments'],           // 
allow comments?
+                                                                               
                'opt_nocomments'        => ( $options['comments'] == 1 ) ? 0 : 
1,            // allow comments?
                                                                                                'opt_preformatted'      => true,                            // event text is preformatted
                                                                                                'opt_backdated'         => $bulk,                           // if true, posts will not appear in friends lists
                                                                                                'taglist'                       => ($options['tag'] != 0 ? $cat_string : ''),

}}}

Original comment by IATkache...@gmail.com on 27 Oct 2011 at 12:41

GoogleCodeExporter commented 8 years ago
I'm having the same issue.  I have my default set to "Allow comments on 
LiveJournal", but comments are still disabled on LJ.  When I go into the entry 
in Wordpress and make sure to select Comments "On", it still doesn't enable 
comments on LJ.

Using version 2.3.1.

Original comment by nananana...@gmail.com on 31 Oct 2011 at 4:07

GoogleCodeExporter commented 8 years ago
Version 2.3.1 -- selecting Comments on (default) on individual posts has worked 
for me.

Original comment by bev.vinc...@gmail.com on 31 Oct 2011 at 4:26

GoogleCodeExporter commented 8 years ago
This should be fixed in 2.3.2, which is up on the project home page and will be 
available via the plugin upgrade screen sometime in the next fifteen minutes.

Please let me know if the problem is not fixed!

Original comment by st...@sillybean.net on 23 Nov 2011 at 10:43