We run cron via scripts/drupal.sh, so SERVER_NAME doesn't not get set in $_SERVER array. However, $_SERVER['HTTP_HOST'] does get set and can be used instead. Attached patch adds an if to determine which to use.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | content_retriever.patch | 1.34 KB | omerida |
| content_retriever.patch | 733 bytes | omerida |
Comments
Comment #1
joachim commentedSeems fair enough; just a few style fixes though.
First, could you indent the code you're wrapping with an if {} block please?
Second, Drupal coding standards have 'elseif' rather than 'else if':
Though do we need the 'if' part of that anyway? What if HTTP_HOST isn't set either? If that can't ever happen, the 'if' is redundant; if it can, then we need a final case.
Powered by Dreditor.
Comment #2
omerida commentedAttached is an updated patch with the code style changes. I also added a Warning if the domain can't be determined.
Comment #3
omerida commentedpatch attached for review in #2
Comment #4
joachim commentedWill need a reroll now #821700: Configurable API Domain on Retriever Sites has been committed.
Also, watch for whitespace changes and other needless changes in a patch.