4 deleted 2 characters in body
source | link

This is a php issue.

$data = 'heeeello';

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  echo $data; // $data is NULL, will also throughthrow a notice
}

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  global $data;
  echo $data; // $data is 'heeeello'
}

regarding your variable_set, the params are different:

$data = 'heeeello';
variable_set('hello', $data);
MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  $data = variable_get('hello');
  echo $data; // $data is 'heeeello'
}

RE edit: this goes towards your extension: variable_set() is not designed to do sets on every request, variables should be quiet consistent, every variable_set will clear your cache (to some extend), abusing this will lead to a lot of performance problems.

If you need a cache use cache_set and cache_get, for singletons/ static stuff use drupal_static. The global variable $test you are using right now in your question, should not return NULL but array(), everything else looks like a different problem.

If you want to build up a storage backend create proper tables using hook_schema or (advanced) build your own entities.

edit: almost forgot, your code from above, is not working because you are not saving that variable again, so even for the second run it will always be empty.

This is a php issue.

$data = 'heeeello';

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  echo $data; // $data is NULL, will also through a notice
}

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  global $data;
  echo $data; // $data is 'heeeello'
}

regarding your variable_set, the params are different:

$data = 'heeeello';
variable_set('hello', $data);
MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  $data = variable_get('hello');
  echo $data; // $data is 'heeeello'
}

RE edit: this goes towards your extension: variable_set() is not designed to do sets on every request, variables should be quiet consistent, every variable_set will clear your cache (to some extend), abusing this will lead to a lot of performance problems.

If you need a cache use cache_set and cache_get, for singletons/ static stuff use drupal_static. The global variable $test you are using right now in your question, should not return NULL but array(), everything else looks like a different problem.

If you want to build up a storage backend create proper tables using hook_schema or (advanced) build your own entities.

edit: almost forgot, your code from above, is not working because you are not saving that variable again, so even for the second run it will always be empty.

This is a php issue.

$data = 'heeeello';

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  echo $data; // $data is NULL, will also throw a notice
}

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  global $data;
  echo $data; // $data is 'heeeello'
}

regarding your variable_set, the params are different:

$data = 'heeeello';
variable_set('hello', $data);
MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  $data = variable_get('hello');
  echo $data; // $data is 'heeeello'
}

RE edit: this goes towards your extension: variable_set() is not designed to do sets on every request, variables should be quiet consistent, every variable_set will clear your cache (to some extend), abusing this will lead to a lot of performance problems.

If you need a cache use cache_set and cache_get, for singletons/ static stuff use drupal_static. The global variable $test you are using right now in your question, should not return NULL but array(), everything else looks like a different problem.

If you want to build up a storage backend create proper tables using hook_schema or (advanced) build your own entities.

edit: almost forgot, your code from above, is not working because you are not saving that variable again, so even for the second run it will always be empty.

3 added 156 characters in body
source | link

This is a php issue.

$data = 'heeeello';

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  echo $data; // $data is NULL, will also through a notice
}

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  global $data;
  echo $data; // $data is 'heeeello'
}

regarding your variable_set, the params are different:

$data = 'heeeello';
variable_set('hello', $data);
MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  $data = variable_get('hello');
  echo $data; // $data is 'heeeello'
}

RE edit: this goes towards your extension: variable_set() is not designed to do sets on every request, variables should be quiet consistent, every variable_set will clear your cache (to some extend), abusing this will lead to a lot of performance problems.

If you need a cache use cache_set and cache_get, for singletons/ static stuff use drupal_static. The global variable $test you are using right now in your question, should not return NULL but array(), everything else looks like a different problem.

If you want to build up a storage backend create proper tables using hook_schema or (advanced) build your own entities.

edit: almost forgot, your code from above, is not working because you are not saving that variable again, so even for the second run it will always be empty.

This is a php issue.

$data = 'heeeello';

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  echo $data; // $data is NULL, will also through a notice
}

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  global $data;
  echo $data; // $data is 'heeeello'
}

regarding your variable_set, the params are different:

$data = 'heeeello';
variable_set('hello', $data);
MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  $data = variable_get('hello');
  echo $data; // $data is 'heeeello'
}

RE edit: this goes towards your extension: variable_set() is not designed to do sets on every request, variables should be quiet consistent, every variable_set will clear your cache (to some extend), abusing this will lead to a lot of performance problems.

If you need a cache use cache_set and cache_get, for singletons/ static stuff use drupal_static. The global variable $test you are using right now in your question, should not return NULL but array(), everything else looks like a different problem.

If you want to build up a storage backend create proper tables using hook_schema or (advanced) build your own entities.

This is a php issue.

$data = 'heeeello';

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  echo $data; // $data is NULL, will also through a notice
}

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  global $data;
  echo $data; // $data is 'heeeello'
}

regarding your variable_set, the params are different:

$data = 'heeeello';
variable_set('hello', $data);
MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  $data = variable_get('hello');
  echo $data; // $data is 'heeeello'
}

RE edit: this goes towards your extension: variable_set() is not designed to do sets on every request, variables should be quiet consistent, every variable_set will clear your cache (to some extend), abusing this will lead to a lot of performance problems.

If you need a cache use cache_set and cache_get, for singletons/ static stuff use drupal_static. The global variable $test you are using right now in your question, should not return NULL but array(), everything else looks like a different problem.

If you want to build up a storage backend create proper tables using hook_schema or (advanced) build your own entities.

edit: almost forgot, your code from above, is not working because you are not saving that variable again, so even for the second run it will always be empty.

2 added 640 characters in body
source | link

This is a php issue.

$data = 'heeeello';

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  echo $data; // $data is NULL, will also through a notice
}

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  global $data;
  echo $data; // $data is 'heeeello'
}

regarding your variable_set, the params are different:

$data = 'heeeello';
variable_set('hello', $data);
MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  $data = variable_get('hello');
  echo $data; // $data is 'heeeello'
}

RE edit: this goes towards your extension: variable_set() is not designed to do sets on every request, variables should be quiet consistent, every variable_set will clear your cache (to some extend), abusing this will lead to a lot of performance problems.

If you need a cache use cache_set and cache_get, for singletons/ static stuff use drupal_static. The global variable $test you are using right now in your question, should not return NULL but array(), everything else looks like a different problem.

If you want to build up a storage backend create proper tables using hook_schema or (advanced) build your own entities.

This is a php issue.

$data = 'heeeello';

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  echo $data; // $data is NULL, will also through a notice
}

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  global $data;
  echo $data; // $data is 'heeeello'
}

regarding your variable_set, the params are different:

$data = 'heeeello';
variable_set('hello', $data);
MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  $data = variable_get('hello');
  echo $data; // $data is 'heeeello'
}

This is a php issue.

$data = 'heeeello';

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  echo $data; // $data is NULL, will also through a notice
}

MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  global $data;
  echo $data; // $data is 'heeeello'
}

regarding your variable_set, the params are different:

$data = 'heeeello';
variable_set('hello', $data);
MY_MODULE_leaflet_views_alter_points_data_alter ($result, &$points) {
  $data = variable_get('hello');
  echo $data; // $data is 'heeeello'
}

RE edit: this goes towards your extension: variable_set() is not designed to do sets on every request, variables should be quiet consistent, every variable_set will clear your cache (to some extend), abusing this will lead to a lot of performance problems.

If you need a cache use cache_set and cache_get, for singletons/ static stuff use drupal_static. The global variable $test you are using right now in your question, should not return NULL but array(), everything else looks like a different problem.

If you want to build up a storage backend create proper tables using hook_schema or (advanced) build your own entities.

1
source | link