I upgraded Squiz Matrix a few days back from 4.12.2 to 4.14.1. Now I am finding that asset builder pages that try to create "News Item" asset types show in my browser as raw HTML code, as if the html source for the page is wrapped in <pre> tags. On further investigation (using wget -S to fetch such a page - e.g. http://www.iycr.org/addtest) the HTTP Content-type header shows as application/json:
Is this a known bug, or have I unwittingly broken something? Any ideas for a workaround?
Well the link that you posted, http://www.iycr.org/addtest doesn't have a design applied, there are no html or body tags, so that is the issue with that one. If you view the source it is just the HTML of the form, nothing else.
Are you sure what ever else you have tested has a design applied?
> Well the link that you posted, http://www.iycr.org/addtest doesn't have a design applied, there are no html or body tags, so that is the issue with that one.
> If you view the source it is just the HTML of the form, nothing else.
> Are you sure what ever else you have tested has a design applied?
Oh, yes. The production pages do have elaborate designs applied, which is why I created a (very) minimal example. If, for instance, I change the "Asset Types to Create" in my "addtest" example, I do get a style-free page prompting me to login. I've tested a few other "Asset Types to Create" at random - e.g. File, Standard Page, Redirect Page, Asset Listing Page, JSON Data Source, Multi-Date Calendar Event, RSS Feed, Whats New. All give me the expected "Sign in using the form below" page. Only the News Item (so far) triggers this apparent rendering of verbatim HTML code.
Oh, yes. The production pages do have elaborate designs applied, which is why I created a (very) minimal example. If, for instance, I change the "Asset Types to Create" in my "addtest" example, I do get a style-free page prompting me to login. I've tested a few other "Asset Types to Create" at random - e.g. File, Standard Page, Redirect Page, Asset Listing Page, JSON Data Source, Multi-Date Calendar Event, RSS Feed, Whats New. All give me the expected "Sign in using the form below" page. Only the News Item (so far) triggers this apparent rendering of verbatim HTML code.
Not quite sure what you are saying here.
As I said before, you are seeing the source printed because the pages don't have a design applied, so they don't have proper HTML code to actual render the page in the browser.
So, here I apply a "design" to the login page (doesn't alter the visual appearance, but it's a valid, vanilla design parse file). In this view, the "addtest" asset builder is set up to create a Standard Page:
Same again, but this time the "Asset Types to Create" is changed to "News Item". That is the only difference.
As I mentioned before, in both cases the server is emitting effectively the same html in both cases (you can test this using wget to grab the server output); but in the first case, the http Content-Type header is "text/html", as one would expect; in the second case wget reports it as "application/json". Since the browser reads the Content-type http header, it doesn't try to render the page as HTML in the second case.
> Does this happen if you create a new Asset Builder? Or perhaps a new one under a new site?
Yes and yes. The problem manifested itself on my production website (www.iucr.org) after the upgrade from 4.12.2 to 4.14.1 - existing pages that had full designs applied. In trying to characterise the issue I first created new Asset Builders within the same site; and then to rule out site-specific oddities, I created the ones I've been using to illustrate the problem under the www.iycr.org site. Unfortunately I haven't the resources free at the moment to test on a completely new Matrix installation, hence polling this forum to see if other users are seeing this on a 4.14.1 site?
Well, that's helpful (I suppose). I'm a little reluctant to roll back to last week's state because of new content that has come in over the last few days, but it does look as though I've probably broken something in the upgrade...
Well, that's helpful (I suppose). I'm a little reluctant to roll back to last week's state because of new content that has come in over the last few days, but it does look as though I've probably broken something in the upgrade...
Yes. I'm wondering if there's an easy way to check the integrity of the matrix source files, e.g. by running the update script again - to update from the current version to the current version, as it were?
When I get back into the office tomorrow, I'll run the system integrity check scripts to see if they throw up any clues.
Update (1) on this. The output from system_check.php is summarised below. Wish I had done this earlier, since there's certainly some cruft in there, but does it look like any of the reported errors might trigger the odd behaviour I'm seeing?
Form Integrity Test [ OK ]
Dead Assets Test [ !! ]
There are 37 dead asset(s) on the system
Asset #2649 was not found on the system (etc)
Invalid Matrix Links Test [ OK ]
Orphaned Assets Test [ OK ]
Dead File Revisions [ !! ]
There are 1551 orphaned file repository entries to clean up.
Will clean up these asset ids: 6897 (etc...) Broken Sort Order Test [ !! ]
There are 52 broken sort orders found on the system
The Asset #60564 has 5 assets underneath, but the sort order finishes at 3 (etc...)
Fragmented Rollback Test [ OK ]
General Status Check [ info ]
There are 63446 asset(s) on the system
There are 64762 asset link(s) on the system
HTML Tidy Errors Test [ !! ]
There are 3939 content types with HTML Tidy issues
HTML Tidy has not validated Asset #16237 (etc...)
Invalid Incomplete Attachments Test [ OK ]
Invalid Links on Link Tree Test [ OK ]
Submission Integrity Test [ OK ]
Fragmented Attributes Test [ OK ]
Invalid Number of Kids on Link Tree Test [ !! ]
There are 3 invalid number of kids found on the system
Link #2060 has 30 kids listed, but actually 29 kids were found
Link #2386 has 204 kids listed, but actually 203 kids were found
Link #133008 has 5 kids listed, but actually 3 kids were found
User Permissions Test [ OK ]
Update (2). As part of my backup strategy I have a "warm spare" machine to which we rsync the contents of the matrix filesystem every night. We don't, however, reload the database. (The rationale is that if we lose our primary server, unpacking the filesystem backup is very time consuming, since we have about 40 GB of files. By comparison, reloading the database takes much less time.) So, if I fire up apache and start postgres (but do not reload the database) on this machine, I see the same problem with the Asset Builder. From this I deduce that either
(a) this is purely a problem with the php scripts, i.e. the Matrix source; or
(b) the database upgrade on the production machine didn't work/complete properly (but I didn't notice any error messages during the upgrade - unfortunately I didn't capture the output from the upgrade process).
Any thoughts before I put back the clock and revert to my 4.12 installation?
A few other anomalies have since come to light, and it appears to be a database table corruption. Reverting to last known good backup, and I'll take it from there :-(
We’ve actually hit a similar issue this week during testing of a newly upgraded system; Squiz Labs has investigated and released a patch. You can find the bug description here:
We've actually hit a similar issue this week during testing of a newly upgraded system; Squiz Labs has investigated and released a patch. You can find the bug description here: http://bugs.matrix.squiz.net/view_bug.php?bug_id=6315
The patch diff (for fudge/general/general.inc) is available from our CVS repository:
Heh. Wish I'd read this before reverting to my prior-version backup and syncing up the new content that had come in subsequently. Still, it's given me some useful practice in backup/restore :-)
Anyway, back on track. I've applied the patch and confirm it makes the reported problem go away (likewise for a similar case we found for Asset Builder pages creating Single Calendar Items).