0

I am wondering if they are, as that would explain why a simple change to one of my variables in my config.php file is not showing up in the DOM.

Here is what is making me suspect this.

In my fls_price_calculator_2012 module in my includes directory I have a file called config.php.

I am trying to change my $START_DATES_OPTIONS_COMBINATIONS['Specialty Tours'] variable to look like the following:

$START_DATES_OPTIONS_COMBINATIONS['Specialty Tours']['Surf Camp - Saddleback College'] = array('June 29, 2014', 'July 6, 2014', 'July 13, 2014', 'July 20, 2014', 'June 28, 2015');

Simply adding June 28, 2015 as a last option to the array.

The php file is included in my .module file for the module, following this line:

include_once('includes/config.php')

in my fls_price_calculator_2012.module file.

The variable itself is added into a hidden <input> variable in the DOM in the same .module file like so:

$tour_start_dates = '<input type="hidden" id="tour_start_dates" etc...>'
foreach ($START_DATES_COMBINATIONS['Specialty Tours'] as $key => $value){
  //populates the above created input with the keys and values
}

once it is all loaded in the DOM, I search via the Javascript console for the #tour_start_dates element but I get the only the old value for Surf Camp - Saddleback College and I don't understand how that is happening.

  • 2
    No, Drupal won't cache the results of your custom code unless you explicitly tell it to, or the output is contained within something that Drupal is already responsible for caching (e.g. block content) – Clive Oct 29 '14 at 17:02
  • @Clive so do you have any idea why this simple change to my config.php file is not being picked up in production? – Thalatta Oct 29 '14 at 17:07
  • are you using a php optimizer with a cache lifetime that hasn't cleared yet? – tenken Oct 29 '14 at 17:09
  • i am not sure, this is a legacy Drupal site. Would it be listed as a recognizable php optimizer module? – Thalatta Oct 29 '14 at 17:10
  • @tenken the only optimizer I use that caches anything is ImageCache. I don't see any php optimizers on my Module page. – Thalatta Oct 29 '14 at 17:28
0

To answer it literally - probably, yes, on many levels:

  • Filesystem cache
  • Opcode cache
  • Possible other caches, depends on your configuration

Above caches should not create the effect you are seeing, but outout of the whole page is also cached, in your browser. Inspect headers to make sure it was not the case, and if so, clear caches and try again. If you have any proxy or reverse proxy, make sure they are not interfering, too.

If you are sure pages are not cached at output, and you didn't make Drupal to cache your variable, it shouldn't be cached. So there are two options:

  1. Problems with include path:

    Files are included based on the file path given or, if none is given, the include_path specified. If the file isn't found in the include_path, include will finally check in the calling script's own directory and the current working directory before failing.

    Maybe there is another instance of this file somewhere, one that gets higher priority in including? That's one of the reasons to use module_load_include instead.

  2. Problems with uploading. You know what you sent to your server. But have you inspected (from console, for example) what really is there? Maybe you are looking for something that isn't even there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.