Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID


edited March 2013 in Apps

I'm investigating versions and have one question and one problem so far. The question: would it make sense to add Version::add ($app) to the crud app handler creator?

The problem: admin/versions has a dropdown list of choices including Block, Event, Webpage, and properties\Properties. If I choose properties\Properties, I get this error:

ErrorException: sprintf(): Too few arguments
sprintf ("/admin/versions?type=properties\Properties&id=&offset=%d?id=&type=properties%5CProperties", 2)

76 /path/to/apps/navigation/handlers/pager.php

74. $o->last_screen = ceil ($o->total / $o->limit); // the num of the last screen
76. $o->next_link = sprintf ($o->url, $o->next);

Actually, one more question. I installed the Events app at one point, but I have since uninstalled it. Do you know why it shows up in the list of versions available?


  • The error was because of the line I added preserving the query string. I commented that line out and the error went away.

    And maybe the app doesn't need to do Version::add? Because there are versions of the different properties already.

  • Looks like the query string contains a % from url encoding that's causing the sprintf() to want more than one additional argument. Moving it to after all the sprintf() calls seems to do the trick (just pushed to Github).

    Adding versions gives a sort of backup/restore option, so I usually try to use it as much as I can. The one thing that bugs me is that users still see names like "properties\Properties" in the versions type list. I'm still thinking on the best way to add better names for those...

    And you're probably still seeing events in there if there were any previously created/saved.

  • Re: Versions -- I completely agree that it's a good idea. I looked at the blocks code and noticed the Version::add ($b) right after the put (), so I added Version::add ($properties) to my handlers. But then I noticed that there were already versions of the property listings I've created. Does adding a version happen automatically upon Model::put()?

    Re: query string/url encoding -- sounds good, thanks.

    Re: events -- Do we need an app uninstaller, or is there already one? I've been uninstalling apps just by rm -fring their directories. There's probably a better way...

  • Model doesn't explicitly call Versions anywhere, but if you generated your app from the ./elefant crud-app command, that automatically includes the Versions::add() calls in the add/edit forms.

    And at the moment there's no uninstaller, although I suppose something similar to the install/upgrade routines could be used, maybe from the command line tool since apps that weren't installed through the web likely can't be deleted from the web due to permissions...

Sign In or Register to comment.