Posted by bpeicher on January 5, 2013 at 10:59pm
I have a custom php file that is used to create nodes, and it is sitting two directories off of the drupal root like this:
drupal_root/folder_1/folder_2/custom.php
When a node is created via that script, I have a rule that emails the administrator the aliased path to that node. The alias should be like this:
http://domain.com/9384024834
However, the URL being sent is:
http://domain.com/folder_1/folder_2/9384024834
I think this has something to do with a chdir in order to bootstrap Drupal. Here's how it is done in my custom.php file:
chdir('../../../drupal_root');
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);Any solutions?
Comments
Is the actual path alias
Is the actual path alias incorrect or is it only the path in the email?
It is only the path in the
It is only the path in the email. The actual path is correct. Very strange...
In the rules email I am using
In the rules email I am using
[node:url]I would guess the token is
I would guess the token is incorrect in this case.
How about instead of
[node:url]try[site:url]/node/[node:nid]. (Note I am guessing at the token strings, they may need to be adjusted)It had something to do with
It had something to do with where the file was - I created a custom module and the problem is fixed. Thanks for the feedback!