This is a child task for #422380: Convert all core module to use new static caching API focusing on the blog module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JamesAn’s picture

Title: Update blog module to use drupal_static() » Update blogapi module to use drupal_static()
Component: blog.module » blogapi.module
Status: Active » Needs review
FileSize
657 bytes

The blog module doesn't use static vars. The blogapi module uses 1 static var, $xmlrpcusererr, in blogapi_error(). I'm not sure what this static var does, but it's never reset.

cburschka’s picture

Adding a comment to that effect seems just superfluous, though. Change it or don't change it...

Wait, isn't the drupal_static intended to allow a clearing of *all* statics, even those that functions don't intend to reset, during tests?

JamesAn’s picture

FileSize
664 bytes

Makes sense. I was probably running on automatic.. =P There were a small handful of static vars, mostly in the testing code, that remained static. But yes, the majority of static vars should be converted over as was intended.

JamesAn’s picture

FileSize
665 bytes
catch’s picture

Status: Needs review » Reviewed & tested by the community
Dries’s picture

deimos:drupal-cvs dries$ grep -r xmlrpcusererr .
./modules/blogapi/blogapi.module:  static $xmlrpcusererr;
./modules/blogapi/blogapi.module:  return xmlrpc_error($xmlrpcusererr + 1, strip_tags($message));

The variable is never set ... That code doesn't make sense to me.

JamesAn’s picture

Well, the patch turns the first result into:
modules/blogapi/blogapi.module: $xmlrpcusererr = &drupal_static(__FUNCTION__);

The second line has been with Drupal since at least 4.6, according to api.drupal.org. You're right. It seems $xmlrpcusererr is never set. Still, I'm not familiar with the XML-RPC protocol.

Maybe someone who knows more about the BlogAPI can shed some light?

Dries’s picture

Status: Reviewed & tested by the community » Needs review

Let's discuss or research this some more.

Status: Needs review » Needs work

The last submitted patch failed testing.

lilou’s picture

Status: Needs work » Closed (won't fix)

Blog API is removed : #537434: Drop the blog API from core
So this won't be necessary anymore.

apaderno’s picture

Component: blogapi.module » ajax system
Issue summary: View changes
Status: Closed (won't fix) » Closed (outdated)
apaderno’s picture

Component: ajax system » other