Announcement

Collapse
No announcement yet.

Fatal error functions.php keeps returning - Bug or Bad practice?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fatal error functions.php keeps returning - Bug or Bad practice?

    Hi,
    Probably i'm not doing something in the correct way. But when I modify Dynamik Custom Functions I get an error like:
    Fatal error: Cannot redeclare sp_post_info_filter() (previously declared in /.../custom-functions.php:94) in ... on line 178

    So I removed that piece of code with file manager cpanel:
    //* Customize the post info function
    add_filter( 'genesis_post_info', 'sp_post_info_filter' );
    function sp_post_info_filter($post_info) {
    if ( !is_page() ) {
    $post_info = '[post_date] door [post_author_posts_link] [post_comments] [post_edit]';
    return $post_info;
    }}

    When I refresh the webpage is ok, but when I do something more in the dynamik admin I get the same error again and the 'bad' code is back in custom-functions.php.

    Is something keeping it in memory? Should I remove it in filemanager first and then remove it in Dynamik Custom Functions again? What is the best way to handle these errors?


  • #2
    Here´s a video that shows how to handle white screen / php errors causes by functions. Note that there are two necessary steps:
    http://cobaltapps.club/forum/ma...1386#post31386
    Is something keeping it in memory? Should I remove it in filemanager first and then remove it in Dynamik Custom Functions again?
    Yup, and then don´t forget to save - only then the change will make it to database also.

    I don´t see anything obvious wrong with the code you posted, on the other hand we don´t know if there´s more and if you left the necessary first two lines in the functions file while deleting stuff.
    Last edited by SiGa; 09-24-2015, 12:51 PM.

    Comment


    • #3
      Thanks. It's good to know it is not a bug but that I should do the following:
      1. Filemanager: remove or correct code
      2. Go to Dynamik Custom Functions and redo that to save in database.

      Comment

      Working...
      X