#2850 - Inconsistency in templates_internalise_screen.php
| Identifier | #2850 |
|---|---|
| Issue type | Minor issue (breaks specific functionality) |
| Title | Inconsistency in templates_internalise_screen.php |
| Status | Closed (no changes needed) |
| Handling member | Chris Graham |
| Addon | core |
| Description | There is an inconsistency with the templates_internalise_screen.php file, namely this line:
'REFRESH_IF_CHANGED' => md5(serialize($refresh_if_changed)), What happens is you're MD5ing and serializing something that was already mD5ed and serialized via. the change_detection hooks. As a result, change_detection.php inaccurately determines whether or not something changed. Usually it'll say something has changed regardless. To fix, use this line instead: 'REFRESH_IF_CHANGED' => $refresh_if_changed, |
| Steps to reproduce | |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
I've confirmed this by removing it from templates_internalise_screen.php but leaving it in the hooks. The value is still transferred to AJAX template in MD% format, but it actually matches when there's no change this time opposed to being different.
1) md5+serialize done
2) this is passed to template
3) this is passed via AJAX to hook
4) md5+serialize done within hook
6) this is compared to what was passed
7) if they are the same, AJAX is told there was no change
i.e. the hook is only for AJAX, and does not run at all prior to AJAX. The md5 is intentionally done twice because that is the comparison. It is not done twice in sequence to the same data.