Log in
Elgg Technical Support

Elgg Technical Support

Get support from other Elgg users

Deprecated in 1.7: extend_view() was deprecated by elgg_extend_view()!

Hi everyone.

I'm getting this error on my elgg install :

Deprecated in 1.7: extend_view() was deprecated by elgg_extend_view()!

 

It can appear while posting, or even refreshing, but not always. The site worked like 3 monthes without having this once, and now this error message pop sometimes.

Can someone help me ?

Replies

  • pradacaca 1219 days ago

    Here's tyhe origin of the error message : 

    engine/lib/views.php

     

     

    00958 function extend_view($view, $view_name, $priority = 501, $viewtype = '') {
    00959     elgg_deprecated_notice('extend_view() was deprecated by elgg_extend_view()!', 1.7);
    00960     elgg_extend_view($view, $view_name, $priority, $viewtype);

     

    But what does it mean ? How can I solve it ?

  • Brett 1219 days ago

    It means you're using a plugin that hasn't been updated to the latest functions.  Where is this message showing up and what version of Elgg are you using?  If you have debug enabled, it will log which file is calling extend_view() instead of elgg_extend_view().

  • pradacaca 1219 days ago

    I'm using 1.7.5, but a plugin might be out of date...

    The message is showing in the ajox pop ups (like you comment has been posted, etc...)

    Is it safe to enable debbug ?

  • Brett 1219 days ago

    That error shouldn't be showing up in a javascript popup until 1.8, so there might be a bug in Elgg core.

    If you enable debug it will write to a debug log.  Its location depends upon your server setup.  It's safe, but unless you know where to look it might not be useful.  It could write either to a PHP specific log, or to an apache log, so be sure to check both.

  • pradacaca 1219 days ago

    Here it is :

    image

    So, if I find the plugin, I just might update it ? or rename the function ?

  • Cash 1218 days ago

    We've had no reports of this so I doubt it is a core issue. You could try turning off plugins until the problem goes away.

  • pradacaca 1214 days ago

    So I checks the start.php of all my plugins, et no one still uses extend_view.

    But this morning I got   Deprecated in 1.7: extend_view() was deprecated by elgg_extend_view()!

     

    So I was wondering, can this fontion be located elsewhere than in start.php ?

  • Per Jensen 1214 days ago

    Yes. If your editor has a search function, it's easy to find "extend_view(".

  • pradacaca 1214 days ago

    it's only in plugins right ?

    Is the a way to avoid doing this to all php files one by one ?

  • Brett 1214 days ago

    @pradacaca - I just noticed there are commas in the version number.  This makes me think there might be a locale issue where 1.7 and 1,7 are being compared as strings instead of ints.  What locale are you using?  Put this in a file and run it from your server, then link me or C&P the results:

    var_dump(setlocale(LC_ALL, null));

    var_dump(setlocale(LC_NUMERIC, null));

    var_dump(localeconv());

  • pradacaca 1213 days ago

    Excuse my ignorance but what is a locale ?

    And How do I run these lines ? By ftp ?

  • Brett 1213 days ago

    No need to do this--I confirmed it is a bug in core: http://trac.elgg.org/ticket/2749

    To answer the question, a locale tells PHP how to format strings like numbers, currency, and dates.  We use a dot for a decimal point and a comma for the thousands separator in the US: 3.14159, 1,701, 1.7, etc.  Your locale reverses this: 3,14159, 1.701, 1,7.  The comma is confusing the comparison in PHP somewhere, probably because it's looking at them as strings instead of numbers.

    To put this on your server, you'd copy and paste the lines into a PHP file on your server.  There needs to be a <?php at the start of the file.  You can FTP them or edit them directly on the server.

  • anirupdutta 1211 days ago

    just change every instance of extend_view() to elgg_extend_view().I guess it should work coz it worked in my case albeit the opposite case.I run a old version of elgg and I had a new plugin which used a function called elgg_view_friendly_time(),I changed it to friendly_time() and it worked fine.

    If you use Linux or run cygwin on Windows searching is very easy

    just type

    find . -name "*.*"  |  xargs grep "extend_view()" to find all the instances.Run this at any directory you wish and it will search the directory as well as the sub directory.

    if you want the script

    !/bin/bash
    #change the path according to your wish

    startdirectory="/home/something/elgg/mod"
    searchterm="extend_view()"
    replaceterm="elgg_extend_view()"

            for file in $(grep -l -R $searchterm $startdirectory)
              do
               sed -e "s/$searchterm/$replaceterm/ig" $file > /tmp/tempfile.tmp
               mv /tmp/tempfile.tmp $file
               echo "Modified: " $file
            done

    echo " Changes Done"

  • pradacaca 1209 days ago

    Thx for the answers ! 

    So, since this is a core pb, I will only have tu upgrade to 1.7.6 and it will be solved right ?

     

    (Mine is 1.7.5, but it seems 1.7.6 is already out, will it be fixed in 1.7.7 or does 1.7.6 fixes it ?)

  • pradacaca 1200 days ago

    Can someone answer this please ?

  • Brett 1200 days ago

    This was reported after 1.7.6 was released so it will be in 1.7.7.  If you look at the trac ticket I linked to, the "milestone" tells you which version it's scheduled to be in.

  • Andres 1039 days ago

    Hi, I am having the same issue with the version 1.7.8, I guess more of the modules I am using are out of day, 
    I am new workin with elgg, so you guys can recomend me a version which most of the plugins are available?
     

  • iionly 1039 days ago

    @Andres: if you start a fresh site, you should use the latest stable release of Elgg (currently 1.7.10). If a plugin is not compatible because it hasn't been updated yet to work with Elgg 1.7, it most likely will never get upgraded anymore anyway. So, you should rather avoid using such a plugin. But most important plugins will work with Elgg 1.7. You can check when the last version of a plugin was released on the plugin download pages. Roughly 1 - 1,5 years is the timeframe a plugin should be last upgraded to work with Elgg 1.7 (there are older plugins that work with 1.7 without problems but you would need to test this best on a test installation before using it on a productive site.

  • Andres 1031 days ago

    thanks iionly

  • kxx4 945 days ago

    I have this error report aftrer enabling plugins upon upgrading from 1.7.6 to 1.8.0.1.How do I upgrade the plugins to work

You must log in to post replies.