How do you get rid of this warning in 1.8 for older plugins

Deprecated in 1.8: settings/polls/edit was deprecated in favor of plugins/polls/settings 

Hi, I feel a little embarrassed to ask this as I am sure it is very easy to solve. I can fix all the other plugin issues with Elgg okay but I just cannot yet after a few days of using Elgg find out how to stop the above error message from showing.

 

What do I need to do to get rid of it? With all other error messages I can find my way around and change the code but with this one I am stumped. It looks like it is asking me to change the naming convention of the folders and files - is this the case? I did try this but obviously the code inside the files then needs changing to point to the right folders and files and I am wary about doing this.

 

Any help appreciated please.

 

 

  • @THT

    Thanks for the help it's appreciated greatly, I just hope when/if I get it working people will use it; I always feel bad just using stuff and not being able to contribute so now i'm trying to as the paths for the files where the errors are are displayed. Before they just told you there was an eroor which for people like me wasn't much help

     

    anyway thanks again i'll let you know if it works

     

    regards

  • @THT

    Still no joy; i'll keep plugin tho'

    regards

  • Try
    // Create a layout
    //$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2);
    $body = elgg_view_layout('two_column_left_sidebar', array($area1, $area2) );
    and..
     
    PS: @THT - Please do not post such mish-mashed code again ! ;-)
    I may make it sound funn-y but it ain't.

     

     

     


  • Hi can anyone still help me with this issue which remains:

    My problem is:

    I have just found this error [ Deprecated in 1.8: Please update your use of elgg_view_entity_list() Called from ] .......... on a specific groups profile page on the front end of my site.

    So I go to the file in question e.g. group_module.php

    and I hope to see an older use of elgg_view_entity_list ........ but when I search I see that this is already named so:

    elgg_push_context('widget');

    $events = event_manager_search_events($event_options);

    $content = elgg_view_entity_list($events['entities'], 0, 0, 5, false);

    elgg_pop_context();

    Therefore - does anyone know what I have to change?

  • Okay I appear to have solved it!!!!!!!

    For future reference. I tried deleting the line of code:

    $content = elgg_view_entity_list($events['entities'], 0, 0, 5, false);

    and yes believe it or not, the error is gone and a bug which I hadn't noticed was fixed. I have tested all event actions and nothing appears to be effected in any negative way at all.

    The bug deleting it fixed was one I had only just noticed whereby any event was showing in any group, whether that group was relevant or not: e.g. an event for paint would be showing in a group for cars!!

    I deleted the line of code and everything works!

  • Right I've made some progress at least... I have got rid of this error:

     

    "Deprecated in 1.8: The use of unlimited optional string arguments in elgg_view_layout() was deprecated in favor of an options array"
    but now I have a blank page

     

     

    This is what I have so far:

    // Create a layout

              $body = elgg_view('socialcommerce/all', array('content' => $area2));

    // Finally draw the page

    $params = array('content' => $area2, 'sidebar' => $area1);

    $otherstuff = sprintf(elgg_echo("stores:all:products"),elgg_get_page_owner_entity()->name);

    echo  elgg_view_page($title, $body);

    I'm trying to learn how to get params and then load them into the page (I guess that's what I'm trying to do, my terminology is probably way off lol)but I'm slightly stuck. If anybody could give me a tip.

    Thanks again. 

    lind regards

     

  • did 'you get rid rid if this error..' ? with the code i posted above or different ? :-
    Try
    // Create a layout
    //$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2);
    $body = elgg_view_layout('two_column_left_sidebar', array($area1, $area2) );
    while that new code :-
    $params = array('content' => $area2, 'sidebar' => $area1);
    $otherstuff = sprintf(elgg_echo("stores:all:products"),elgg_get_page_owner_entity()->name);
    echo  elgg_view_page($title, $body);
    does not make any sense ;-(


  • @Dhrup, sorry to point this out, but your approach is not very Elggy. You want your params array to be associated, so that it can be passed along the elgg_view. And 'two_column_left_sidebar' is long deprecated...

     

    @Stumpy, your code indeed doesn't make much sense. You get a white page, because there is no such view as 'socialcommerce/all', there is a view 'page/layouts/socialcommerce/view', which can be accessed via a helper function elgg_view_layout()

     The following are equivalent:

    $page = elgg_view_layout('one_sidebar', array(
     'content' => $content,
     'sidebar' => $sidebar
     ));
    
    $page_alt = elgg_view('page/layouts/one_sidebar', array(
     'content' => $content,
     'sidebar' => $sidebar
     ));
     

    If you are in a view, all your params are in $vars.

    Let's say you have created a custom layout called 'my_custom_layout' and placed it in 'page/layouts/custom/my_custom_layout.php'.

    In page_handler or other view:

    $page = elgg_view_layout('custom/my_custom_layout', array(
     'content' => $content,
     'sidebar' => $sidebar,
     'some_other_html_I_want_to_render' => $other_html
     ));
    $title = elgg_echo('custom:page:title', array(elgg_get_logged_in_user_entity()->name)); // note you do not need to use sprintf, it's already built into elgg_echo()
    echo elgg_view_page($page, $title);

    In my_custom_layout view:

    $content = $vars['content']; // this is the 'content' you just passed above
    $sidebar = elgg_extract('sidebar', $vars, null); // alternative way of access the variable and assigning a default value if not assigned
    $other_html = $vars['some_other_html_I_want_to_render'];
     
    $html = <<<HTML
     <div class="content">
     $content
     <div class="other-content">
     $other_html
     </div>
     </div>
     <div class="sidebar">
     $sidebar
     </div>
    HTML;
     
    echo $html;
  • @wwwcjb, removing is not really a solution. 

    Since 1.8, elgg_view_entity_list() accepts an array as a second parameter. So, look up in 1.7 reference what those 0s and 5s stand for and replace them with:

    elgg_view_entity_list($entities, array(
     'limit' => $limit,
    'count' => $count,
    // whatever your values represent 
     ));
     
  • @IK - touché - U R right re: *assoc ;-) shudda noticed !

Feedback and Planning

Feedback and Planning

Discussions about the past, present, and future of Elgg and this community site.