Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By PieroB83 on
Hello everyone,
when I run cron.php I get a redirect to a page.
Maybe I've a drupal_goto inside a node, but I don't know which node (I've thousands of them).
How can I find where drupal_goto is?
Many thanks to all!
P
Comments
Use phpmyadmin to search -
Use phpmyadmin to search - might as well just search the whole db, though if it is there is must be in a field, probably body field. Also check for a drupal_goto() in any custom code, as in certain circumstances (when it is called late in the bootstrap) it can cause problems in the codebase too.
If you want to do the job properly, search for
<?php
in the database and delete any node where you find it... php module is evil!Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors
no php code found. What else
no php code found. What else can cause the redirect on the cron?
thanks all!
P
Did you read this part of my
Did you read this part of my post:
Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors
Can this not be detected
Can this not be detected using something like Firebug?
Ouch - no. It is important
Ouch - no. It is important that we all treat everyone here courteously, and in that context some things should still be said, so with great respect I will say that maybe presenting your core skills as Drupal Developer is not really fair to people who have spent many years learning this stuff (not that I am an expert developer, and I don't claim to be).
FWIW you have my sympathy because I struggled a lot with this issue on a site, and I removed drupal_goto from the database. However, the site (an important and large one) suffered a major problem because I mis-used drupal_goto in code, a mistake someone with deeper knowledge of Drupal dev would not have made.
You need to search the codebase. This is really only possible from command line using grep. However, if you built the site, you will will already know if there is some custom code, and if there is not, that cannot be the problem.
Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors
I fully agree with your
I fully agree with your sentiment John - but I think you didn't realize the poster you were replying to wasn't the same poster that started the thread.
That is true.
That is true.
Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors
Event Log
I wonder if the Event Log module would log where the redirect came from
Nope.
Nope.
Edit: John already gave the correct answer. The redirect will exist in one of three places. The database, the code, or an .htaccess file. It's doubtful that it's in an .htaccess, and the db has already been searched. So the last place is to search the code base for drupal_goto.