<div dir="ltr">It would be useful for Koha to have a 'Deprecated' function, which would send a warning about the caller() function and the version of Koha where the function will be deprecated, and what it will be replaced by... so let's say that C4::Adequate::DoEET() is being replaced by Koha::Awesome->sauce(). in Koha 18.11.<div><br></div><div>In versions of koha prior to 18.11, we add a call to</div><div><br></div><div>deprecated( "18.11", "Koha::Awesome->sauce()");</div><div><br></div><div>at the beginning of C4::Adequate::DoEET(). </div><div><br></div><div>Then, when C4::Adequate::DoEET() is called, this would generate the following message in the logs:</div><div><br></div><div>"C4::Adequate::DoEET is deprecated and will be removed in Koha 18.11. It will be replaced by Koha::Awesome->sauce()."</div><div><br></div><div>This would allow plugin authors to know that they will need to patch their plugins before they break on upgrade.<br><div><div><div><div><div><div><br></div><div>This is a bare-bones implementation of deprecated():</div><div><br></div><div><div>sub deprecated {</div><div>    my ( $version, $replacement ) = @_;</div><div>    my (</div><div>        $package, $filename, $line, $subroutine, $hasargs,</div><div>        $wantarray, $evaltext, $is_require, $hints, $bitmask, $hinthash</div><div>    ) = caller(1);</div><div>    warn( </div><div>        "${subroutine} is deprecated and will be removed"</div><div>         . " in Koha version $version."</div><div>         . defined( $replacement ) </div><div>            ? " It will be replaced by ${replacement}."</div><div>            : ""</div><div>    );</div><div>}</div></div><div><br></div><div><div><br></div></div></div></div></div></div></div></div></div>