Okay
  Public Ticket #2481172
CURRENT_POST_ID Placeholder usage failure on Set Predefined value
Closed

Comments

  • Ozgur Kaya started the conversation

    Hi to all,

    I have purchased your product(wpdatatables v2.3) before. I bought the new version(v3.0.1), where I had a problem. However, the problem continues.

    I am tring to use your %CURRENT_POST_ID% placeholder in add/edit popup. It's working on frontend but there is a critical failure on dataTable. when I want to return back to the same wpdata table to edit I am getting this error and can't edit the table anymore and deleting the table and trying to do this again with an another way..

    1-Open column settings, 

    2-Click EDITING Tab, 

    3-Set Predefined value(s) as %CURRENT_POST_ID%.. 

    4- Save all and exit and come back again to table management for editing.. You can't access the WpDatatable anymore..

    ERROR MESSAGE on top of the admin screen:

     Trying to get property 'ID' of non-object in /var/www/html/wp-content/plugins/wpdatatables/source/class.wpdatacolumn.php on line 707

    Frontend side seems working, there is no problem. But it does not important without backend.

    Please fix this issue for me , otherwise you could cancel my subscription and take it back newly purchase of the same product again! Thanks.

  • Ozgur Kaya replied

    Change this line (wpdatacolumn.php on line 707) like this and add the sollowing function to your PHP file. It works.

    $value = str_replace('%CURRENT_POST_ID%', get_the_ID(), $value);

        public static function get_the_ID() {

            $post = get_post();

            return ! empty( $post ) ? $post->ID : false;

        }

  •  2,572
    Aleksandar replied

    Hello Ozgur

    Thank you for letting us know the issue is resolved.

    I have forwarded the ticket to our development team for review.

    Kind Regards, 

    Aleksandar Vuković
    aleksandar.vukovic@tmsproducts.io

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables