Giter Club home page Giter Club logo

Comments (3)

thelovekesh avatar thelovekesh commented on June 3, 2024 1

The deprecation warnings reported by plugintests are visible on the AMP > Error Index page with PHP 8.1.

Deprecation Warnings

image

Stack trace
Array
(
    [0] => Array
        (
            [file] => /app/public/core-dev/build/wp-admin/includes/class-wp-list-table.php
            [line] => 1782
            [function] => handle_row_actions
            [class] => WP_Terms_List_Table
            [type] => ->
        )

    [1] => Array
        (
            [file] => /app/public/core-dev/build/wp-admin/includes/class-wp-terms-list-table.php
            [line] => 352
            [function] => single_row_columns
            [class] => WP_List_Table
            [type] => ->
        )

    [2] => Array
        (
            [file] => /app/public/core-dev/build/wp-admin/includes/class-wp-terms-list-table.php
            [line] => 260
            [function] => single_row
            [class] => WP_Terms_List_Table
            [type] => ->
        )

    [3] => Array
        (
            [file] => /app/public/core-dev/build/wp-admin/includes/class-wp-list-table.php
            [line] => 1618
            [function] => display_rows_or_placeholder
            [class] => WP_Terms_List_Table
            [type] => ->
        )

    [4] => Array
        (
            [file] => /app/public/core-dev/build/wp-admin/edit-tags.php
            [line] => 611
            [function] => display
            [class] => WP_List_Table
            [type] => ->
        )

)

Inside handle_row_actions it generates an edit link for a given term ID which then checks if the current user can edit a particular term ID with edit_term capability. In our case we are using custom capabilities hence it passes null to the add_query_arg() which then generates deprecation warnings.

from amp-wp.

thelovekesh avatar thelovekesh commented on June 3, 2024

@westonruter Reported deprecation warnings are caused by the AMP plugin. Even in the PHPUnit tests CI, we thought all deprecation warnings were due to the GB plugin, but they were due to the AMP plugin as well.

add_query_arg(
$redirect_query_args,
get_edit_post_link( $post_id, 'raw' )
)

get_edit_post_link( $post_id, 'raw' ) always returns null, and later these deprecation warnings are generated within add_query_arg(). Seems like at this point of execution user does not have permission to edit the post hence get_edit_post_link( $post_id, 'raw' ) is returning null.

EDIT:
The above one is only responsible for deprecation warnings in unit tests.

from amp-wp.

pavanpatil1 avatar pavanpatil1 commented on June 3, 2024

QA Passed ✅

Cross-verified the issue and it is working fine. With the WordPress 6.3 the warnings are still visible. These warnings have been successfully addressed in WordPress version 6.4 through this Pull Request - WordPress/wordpress-develop#5198

Before fix After fix
image image

from amp-wp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.