• Resolved coxinha

    (@coxinha)


    Dear all,

    after implenting the new widget Recent Jobs I receive an error for the template:

    Warning: Array to string conversion in /…/wp-content/plugins/jobboardwp/includes/widgets/class-recent-jobs.php on line 65

    I’m using SiteOrigin to build our page.

    Could anyone help me please to solve this error message?

    Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @coxinha

    Please try to edit wp-content/plugins/jobboardwp/includes/widgets/class-recent-jobs.php line 65 and replace

    From:

    $arg = implode( ',', $arg );

    To:

    $value = implode( ',', $arg );
    $arg = $value;

    Let me know if that works,
    Best Regards!

    Thread Starter coxinha

    (@coxinha)

    Thanks for your quick reply, @nsinelnikov

    Changed the template as mentioned above – but error message keeps the same (I’ve deleted cache already).

    Any other suggestions?

    Thanks and regards!

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @coxinha

    Could you share the screenshot with the Widget settings? I’ll try to replicate the same issue on my dev installation.

    Let me know,
    Best Regards!

    Thread Starter coxinha

    (@coxinha)

    Sure. But it’s nearly default.

    See https://snipboard.io/L5ClgK.jpg

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @coxinha

    And what PHP version do you use?

    Best Regards!

    Thread Starter coxinha

    (@coxinha)

    Hi @nsinelnikov

    PHP version 8.0
    WordPress 6.0.2
    JobBoardWP 1.2.1

    Rgds

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @coxinha

    Please try to revert line 65 to

    $arg = implode( ',', $arg );

    And insert these lines before line 65.
    2022-09-27_15-32-05

    if ( empty( $arg ) ) {
        continue;
    }

    It works for my local dev installation with the same PHP, WP and JobBoardWP versions.
    Let me know if that works after changes on your side,
    Best Regards!

    Thread Starter coxinha

    (@coxinha)

    Hi @nsinelnikov

    did as told. So former (amended) line 65 is now line 68. And I’m sorry to say but it still causes an error message.

    • This reply was modified 2 years, 2 months ago by coxinha.
    • This reply was modified 2 years, 2 months ago by coxinha.
    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @coxinha

    It looks so strange. Could you make the var_dump() of the $arg variable for getting debug its value?

    Please insert var_dump($arg); line before line 68.

    Sorry for these issues, but since I can’t track down this issue, my only step is to do it this way.

    Let me know,
    Best Regards!

    Thread Starter coxinha

    (@coxinha)

    Don’t worry, @nsinelnikov

    You’re doing a great job!! I’m so happy about your support.

    After inserting your code it’s getting worse. ??

    This is how my code looks now:

    And this is my new error message:
    array(8) { [“class”]=> string(22) “jb\widgets\Recent_Jobs” [“grid”]=> int(2) [“cell”]=> int(2) [“id”]=> int(11) [“widget_id”]=> string(36) “7ca70136-fe0d-446a-a97f-4062c6bd027f” [“style”]=> array(4) { [“widget_css”]=> string(64) “overflow-y: scroll; height: 500px; margin-bottom: 0px!important;” [“mobile_css”]=> string(64) “overflow-y: scroll; height: 500px; margin-bottom: 0px!important;” [“background_image_attachment”]=> bool(false) [“background_display”]=> string(4) “tile” } [“cell_index”]=> int(1) [“widget_index”]=> int(11) }
    Warning: Array to string conversion in /homepages/45/d616284114/htdocs/clickandbuilds/Butenploener/wp-content/plugins/jobboardwp/includes/widgets/class-recent-jobs.php on line 69

    • This reply was modified 2 years, 2 months ago by coxinha.
    • This reply was modified 2 years, 2 months ago by coxinha.
    Thread Starter coxinha

    (@coxinha)

    PS: I’m definitely not an expert at all but maybe it’s caused by using SiteOrigin.

    Tried to implement your widget to my right sidebar and there it’s working perfectly without any error message.

    Also the shortcode [jb_jobs] isn’t working properly with SiteOrigin after the last update of JobBoardWP. It’s loading something but keeping empty:

    • This reply was modified 2 years, 2 months ago by coxinha.
    Thread Starter coxinha

    (@coxinha)

    Checked the shortcode [jb_jobs/] on a “normal” new page without any SiteOrigin.

    Searchbar is loading but nothing more (none of our jobs):

    On the other hand shortcode for implementing dashboard is working correctly…

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @coxinha

    Thanks for the details.

    1. This code on line 60 will help you to resolve the issue with the Recent Jobs widget:

    if ( ! in_array( $key, array( 'number', 'category', 'type', 'remote_only', 'orderby', 'hide_filled', 'no_logo', 'no_job_types' ), true ) ) {
    	continue;
    }

    2022-09-28_02-57-40

    2. As for the Jobs List. Do you have a public page with Jobs List shortcode where I may check the issues? Did you try to flush the cache or minified/optimize versions? Also please check you you have customized templates in a theme related to the JobBoardWP. You need to upgrade them based on the new versions for v1.2.1. See the list here https://www.screencast.com/t/tW5l9geU

    Let me know if that works or you have other details or questions,
    Best Regards!

    Thread Starter coxinha

    (@coxinha)

    Hi @nsinelnikov

    pls excuse my delayed reply.

    First of all: Thanks for the new code. Now it’s working correctly!! ??

    And finally thanks a lot for your hint concerning customized templates (it was js/jobs-list.php). Now also this page is working perfectly.

    Will mark this post as solved.

    Regards!

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @coxinha

    Thanks for letting me know. Great that all works properly.

    Best Regards!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Warning: Array to string conversion’ is closed to new replies.