Attention Views API developers
http://www.angrydonuts.com/attention-views-api-developers I have just checked in a major change to the Views API. Details can be found in the advanced help under api.html (and the handlers and plugins) pages, but the short version is that all handlers and plugins are now separated into their own files in order to conserve memory and not loaded unneeded code. This required implementing an API versioning system, and the upshot of this is that a new hook must be implemented by all Views modules: hook_views_api(). Without the proper use of this hook, the *.views.inc files will not be included. If your module includes its *.views.inc files itself or keeps its handlers in the .module file, this is wrong and will cause sites to crash.
Can't you make a default, so it's backwards-compatible? Dmitri On Wed, Sep 3, 2008 at 12:26 PM, Earl Miles <merlin@logrus.com> wrote:
http://www.angrydonuts.com/attention-views-api-developers
I have just checked in a major change to the Views API. Details can be found in the advanced help under api.html (and the handlers and plugins) pages, but the short version is that all handlers and plugins are now separated into their own files in order to conserve memory and not loaded unneeded code. This required implementing an API versioning system, and the upshot of this is that a new hook must be implemented by all Views modules: hook_views_api(). Without the proper use of this hook, the *.views.inc files will not be included.
If your module includes its *.views.inc files itself or keeps its handlers in the .module file, this is wrong and will cause sites to crash.
Dmitri G wrote:
Can't you make a default, so it's backwards-compatible?
Yes. The default is "prior to the current" which, if loaded, would crash the system in ways that are unrecoverable. Thus, backward compatible as much as PHP will allow. BTW thanks for publicly assuming that I went through all this effort to be annoying.
On Sep 3, 2008, at 8:56 PM, Earl Miles wrote:
BTW thanks for publicly assuming that I went through all this effort to be annoying.
I think the intention of his question wasn't "you're just being annoying" but rather, "you must have thought of this -- so can you explain why it can't just be backwards compatible?". Cheers, -Derek (dww)
Derek Wright wrote:
On Sep 3, 2008, at 8:56 PM, Earl Miles wrote:
BTW thanks for publicly assuming that I went through all this effort to be annoying.
I think the intention of his question wasn't "you're just being annoying" but rather, "you must have thought of this -- so can you explain why it can't just be backwards compatible?".
Because when you try to inherit classes that aren't loaded, PHP dies a horrible awful death. I'm pretty sure I mentioned the 'causes sites to crash' part already.
On Sep 3, 2008, at 10:48 PM, Earl Miles wrote:
Because when you try to inherit classes that aren't loaded, PHP dies a horrible awful death.
Duly noted, thanks.
I'm pretty sure I mentioned the 'causes sites to crash' part already.
Indeed. However, you didn't explain why, which is completely natural in a summary email that's painting the "short version". That left people with a justifiable curiosity about why the naive solution (having a default implementation of this hook) wouldn't work. Between your latest message in this thread and reading api- handlers.html[1] I now fully understand. Thanks. Speaking only for myself (and probably Dmitri), let me add that I'm not out to get you, blame you, or prove you wrong. ;) I love you and deeply respect your work. I only wanted to give Dmitri the benefit of the doubt, and to learn from your efforts. Thanks, -Derek (dww) [1] http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/ views/help/api-handlers.html?revision=1.2
Derek, you were absolutely correct about what I was thinking. No, I didn't think you were trying to be annoying. I'm sorry if I conveyed that message. I was simply wondering what reason was behind needing to implement the hook. After reading the documentation again, it's more clear to me. Thanks, Dmitri On Wed, Sep 3, 2008 at 11:45 PM, Derek Wright <drupal@dwwright.net> wrote:
On Sep 3, 2008, at 10:48 PM, Earl Miles wrote:
Because when you try to inherit classes that aren't loaded, PHP dies a horrible awful death.
Duly noted, thanks.
I'm pretty sure I mentioned the 'causes sites to crash' part already.
Indeed. However, you didn't explain why, which is completely natural in a summary email that's painting the "short version". That left people with a justifiable curiosity about why the naive solution (having a default implementation of this hook) wouldn't work. Between your latest message in this thread and reading api-handlers.html[1] I now fully understand. Thanks.
Speaking only for myself (and probably Dmitri), let me add that I'm not out to get you, blame you, or prove you wrong. ;) I love you and deeply respect your work. I only wanted to give Dmitri the benefit of the doubt, and to learn from your efforts.
Thanks, -Derek (dww)
[1] http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/views/help/api-...
participants (3)
-
Derek Wright -
Dmitri G -
Earl Miles