Hello,
My website is throwing this error. PHP Fatal error: Call to undefined function _system_rebuild_theme_data()
I created a custom module for the plupload file uploader.
When pressing the upload button, it calls upload.php which resides in sites/all/modules/plupload_file_uploader with the rest of the files.. Within that script I run this code:
define('DRUPAL_ROOT', 'mywebsite');
require_once DRUPAL_ROOT . '\includes\bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
Everything works good if this is commented out:
//drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
When this isn't commented, the above error is thrown. It is failing in themes.inc when calling
list_themes and it makes it to here.
else {
// Scan the installation when the database should not be read.
$themes = _system_rebuild_theme_data();This function is available in the system.module.
We are also using a custom theme. that resides in a folder sites/all/themes/custom/rms
I had this exact same functionality working in a different website on a different web server. Now its being developed locally using Tomcat...and I can't figure out the problem. The purpose of calling this code is to use the drupal session parameters.
It seems like themes.inc cannot see system.module - Is that possible?
Does anyone have any other suggestions? This most likely is not a drupal code problem...but any suggestions will be appreciated.
Thanks!
Comments
With Drupal, you don't create
With Drupal, you don't create files for Ajax callbacks, you register a path using hook_menu() with a callback function for that path. Then you put your code in the path. Example:
With the above function, the path my_module_ajax_callback has been registered. After clearing the cache, this path will become available in the system. When someone accesses this path, the function my_module_ajax_callback() is called:
In the above function, some data is generated (with a hypothetical function some_data()). That data is then printed to the screen, and the page is killed, to prevent it from rendering the data inside a Drupal page.
By using this method, rather than the file you've attempted to use, Drupal is bootstrapped, and all it's functions and APIs are available inside your callback function. You will set the callback path of your AJAX script to 'my_module_ajax_callback'. This will solve your problem.
Contact me to contract me for D7 -> D10/11 migrations.
Thanks for education!
Thank You. Working on this now.