This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Tagged: ,

Alyeska 3.1.0 + WPML 3.1.4 warning

  • Creator
    Topic
  • #15692
    mlmarius
    Participant

    Hi.

    I am using the specified versions of Alyeska and WPML and since the upgrade i started seeing this error message wherever categories are involved in the admin area of wordpress:
    ( more info after error message )

    ———————————————————————————————————-

    Warning: Missing argument 2 for SitePress::terms_clauses() in /srv/www/vhosts/infp2_portal/wordpress/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 5577

    Call Stack:
    0.0219 843872 1. {main}() /srv/www/vhosts/infp2_portal/wordpress/wp-admin/edit.php:0
    5.2261 61732648 2. WP_List_Table->display() /srv/www/vhosts/infp2_portal/wordpress/wp-admin/edit.php:310
    5.2261 61733368 3. WP_List_Table->display_tablenav() /srv/www/vhosts/infp2_portal/wordpress/wp-admin/includes/class-wp-list-table.php:773
    5.2264 61733936 4. WP_Posts_List_Table->extra_tablenav() /srv/www/vhosts/infp2_portal/wordpress/wp-admin/includes/class-wp-list-table.php:825
    5.2269 61737136 5. wp_dropdown_categories() /srv/www/vhosts/infp2_portal/wordpress/wp-admin/includes/class-wp-posts-list-table.php:216
    5.2269 61746128 6. get_terms() /srv/www/vhosts/infp2_portal/wordpress/wp-includes/category-template.php:334
    5.2272 61769608 7. apply_filters() /srv/www/vhosts/infp2_portal/wordpress/wp-includes/taxonomy.php:1466
    5.2272 61774992 8. call_user_func_array() /srv/www/vhosts/infp2_portal/wordpress/wp-includes/plugin.php:199
    5.2272 61775024 9. SitePress->terms_clauses() /srv/www/vhosts/infp2_portal/wordpress/wp-includes/plugin.php:199

    Warning: Missing argument 3 for SitePress::terms_clauses() in /srv/www/vhosts/infp2_portal/wordpress/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 5577

    Call Stack:
    0.0219 843872 1. {main}() /srv/www/vhosts/infp2_portal/wordpress/wp-admin/edit.php:0
    5.2261 61732648 2. WP_List_Table->display() /srv/www/vhosts/infp2_portal/wordpress/wp-admin/edit.php:310
    5.2261 61733368 3. WP_List_Table->display_tablenav() /srv/www/vhosts/infp2_portal/wordpress/wp-admin/includes/class-wp-list-table.php:773
    5.2264 61733936 4. WP_Posts_List_Table->extra_tablenav() /srv/www/vhosts/infp2_portal/wordpress/wp-admin/includes/class-wp-list-table.php:825
    5.2269 61737136 5. wp_dropdown_categories() /srv/www/vhosts/infp2_portal/wordpress/wp-admin/includes/class-wp-posts-list-table.php:216
    5.2269 61746128 6. get_terms() /srv/www/vhosts/infp2_portal/wordpress/wp-includes/category-template.php:334
    5.2272 61769608 7. apply_filters() /srv/www/vhosts/infp2_portal/wordpress/wp-includes/taxonomy.php:1466
    5.2272 61774992 8. call_user_func_array() /srv/www/vhosts/infp2_portal/wordpress/wp-includes/plugin.php:199
    5.2272 61775024 9. SitePress->terms_clauses() /srv/www/vhosts/infp2_portal/wordpress/wp-includes/plugin.php:199

    ———————————————————————————————————-

    One can see the effects of the problem by going to the following areas of the admin:
    Posts -> Add New ( appears at the category selection box )

    The WPML -> WP Menus Sync stopped causing the errors after i removed all categories from the menu structure but was showing the errors if category trees were inserted in the menu

    WPML -> Taxonomy Translation ( apears in multiple areas of the page )

    These errors seem to appear wherever categories are involved. Even in the post quick edit zone.

    The errors do not appear on the default wordpress themes, which is why i am also posting my problem to the Alyeska forum.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • #15694
    Jason Bobich
    Keymaster

    Hello,

    I cannot personally duplicate the PHP warning, but I think this just has to do with the server PHP configuration. However, I believe this is a bug in WPML, but I’m not quite sure what the best solution is. In theory, I can explain —

    Now, in our theme framework, there are a couple of places where we remove the terms_clauses filter, and then add it back again after we’re done retrieving categories. The reason this is necessary is it allows for a couple of places in our theme to pull a list of your categories without them being effected by the current languages selected in the admin.

    This is how we’re doing this:

    global $sitepress;
    
    remove_filter('terms_clauses', array( $sitepress, 'terms_clauses' ) );
    $categories = get_categories();
    add_filter('terms_clauses', array( $sitepress, 'terms_clauses' ) );

    … basically, this is just saying (1) remove WPML’s filters on retrieving a list of categories from WordPress, (2) now get a list of categories from WordPress, and then (3) put it all back.

    This snippet was given to us by WPML support awhile back because we were having issues with this category dilemma. And if I search through their current plugin, I can see where they’re actually doing the same thing in several places.

    What could be the problem? — Originally, when I implemented this, the current version of WPML at the time’s terms_clauses() method was declared in a way where it only accepted one argument. Now, looking at the current version of WPML (3.1.4), it’s declared in a way where the method calls for three arguments.

    So, when you do this:

    add_filter( 'terms_clauses', array( $sitepress, 'terms_clauses' ) );

    … It’s plausible that you could get a PHP warning because we’re only passing one argument through to this method that now requires three. The correct way to do this would be:

    add_filter( 'terms_clauses', array( $sitepress, 'terms_clauses' ), 10, 3 );

    When I search through the current WPML plugin, I can see where they’re doing the same thing of adding the filter, but only doing it so one argument gets passed.

    I think what happened is they modified the method at some point, and then didn’t take into account other places they were making use of it. I have to think they would want to remedy this, and depending on how they remedy would tell us what action to take.

    The quick fix would be to do what I explained a couple paragraphs ago, but then if WPML were to change the method again after discovering this, there would be more errors all over again. So, I’m not quite sure what the immediate solution here is. Have you started a support thread with WMPL about this?

    #15695
    apersei
    Participant

    Hello,

    I also have a similar problem. More specifically in the last few days -and probably after some update i did…- i noticed the following warning in the “posts” page:

    Warning: Missing argument 2 for SitePress::terms_clauses() in /home3/paros/public_html/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 5577

    Warning: Missing argument 3 for SitePress::terms_clauses() in /home3/paros/public_html/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 5577

    The warnings also appear in the “categories” and “tags” pages, and in the “categories” section of the “edit post” page… Other than that, from my part i cannot see a real working problem in my live site, but i don’t know exactly what is happening. My version of wordpress is 3.8.1, of Alyeska is 3.1.1 (I work with a child theme…), of WPML Multilingual CMS is 3.1.4, and of WPML Media is 2.1.3

    The problem seems to be theme related. After deactivating it and activating the Twenty Fourteen, the warnings seem to go away. I also posted the problem in the WPML forum, and they responded that they will contact you for a solution.

    Thank you

    #15697
    mlmarius
    Participant

    Hi. I have an ongoing thread on the WPML support theme. There is a similar thread to mine over there. The person to which that ticket was assigned said that it will contact the Alyeska dev team to try and figure out what is going on. I am watching both threads on WPML regarding this issue and can post updates over here if it gets fixed over there.

    I can also provide you with credentials to my wp instance if you think it’s usefull. May the fact that you do not see the warnings be related to php’s error reporting policy ? I am doing this in an env which allows everything to be reported and i have wp in DEBUG mode. It may go away if i switch the error reporting level but this may affect my application’s logs later on so i’d like to get rid of it.

    Please let me know if there is any way i can help to get a clearer picture of this issue and if an official fix is settled upon.

    Thanks !

    #15699
    Jason Bobich
    Keymaster

    Hey guys, someone from WPML sent me an email, and I have responded. So, I am in contact with them now. I have explained the situation to them, and will let you know what I find out.

    #15700
    apersei
    Participant

    Hello, again

    Jason i posted my previous post as you were posting your reply. I just want to say that both me and mlmarius have started a support thread in WPML forum, before writing here. As i mention earlier the WPML team responded that they will contact you…
    Unfortunately the whole thing is very technical for me. Can you tell me what kind of problems i can expect in the workings of my site from the problem you describe above, since for the time being the problems that i see are just the warnings…

    Thank you

    #15701
    Jason Bobich
    Keymaster

    Realistically it won’t do anything other than make your admin annoying to work with. I would just hold off a bit until we figure it out. I’m sure there’s a simple solution.

    Coincidentally I was getting a minor maintenance update ready to post today or tomorrow for the theme, anyway. So, don’t worry, all will be fixed soon.

    #15821
    mlmarius
    Participant

    Update fixed issue. Thank you very much !

    #15835
    Jason Bobich
    Keymaster

    Awesome, glad to hear it.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The forum ‘Alyeska Responsive WordPress Theme’ is closed to new topics and replies.