Commit de9a24e7 authored by Richard Mansfield's avatar Richard Mansfield Committed by Gerrit Code Review
Browse files

Merge "Add a warning when a pieform element fails to add data to <head> tag"

parents aa87e308 d6d95289
......@@ -1400,6 +1400,11 @@ EOF;
$element['helphtml'] = '<span class="help"><a href="" title="' . Pieform::hsc($element['help']) . '" onclick="return false;">?</a></span>';
}
}
// Issue a warning if this element wants to add something in the <head> tag, and it's too late to do that.
if (defined('PIEFORM_GOT_HEADDATA') && function_exists('pieform_element_' . $element['type'] . '_get_headdata')) {
log_warn('Pieform element ' . $this->name . '_' . $element['name'] . ' wants to add headdata to the page, but it\'s too late. Build your form before generating the page.');
}
}/*}}}*/
/**
......
......@@ -85,6 +85,7 @@ function smarty($javascript = array(), $headers = array(), $pagestrings = array(
if (function_exists('pieform_get_headdata')) {
$headers = array_merge($headers, pieform_get_headdata());
define('PIEFORM_GOT_HEADDATA', 1);
}
// Insert the appropriate javascript tags
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment