I Ain't Afraid of No Ghosts!!!
A Campfire and a Scary Story
With All Hallows Eve aka Halloween fast approaching (my favorite made-up holiday of the year), I figured I would share a little tale of fright, mayhem, blood, and hair raising shrieks in the night... you know, to get you in a spooky mood. So, here goes nothin'... [The setting is night time around a camp fire in a dark wooded area] Once upon a time in quaint southern town, the home of a massive titan of web commerce, there was a web content management deployment with the name WebCenter Sites (WCS). About 3 or 4 months ago, WCS users were ecstatic as they were just handed the keys to a shiny new version of WebCenter Sites (12c... with the help of yours truly... and the rest of Function1's knowledge, of course!). Things were humming along with the fairly standard growing pains that come along with a newly-installed software version (cue: getting to know you... getting to know all about you). Out of the blue, like an apparition in the night, one of its users ran into the room in a cold sweat (metaphorically speaking), "I see dead people," he screamed... err... I what I meant to say is, he said, "I see dead Pages." I jumped out of my seat and screamed "AAAAHHHHHH!!!" Then, in a confused voice I said, "Dead Pages? What the heck is that?" I quickly reassured him that I'd put on my favorite blue Ghostbusters t-shirt and promptly launch a paranormal software investigation into the matter.
Looking for Ghost Pages in the Machine
After a bit of poking around in the system, it was clear as day that the Page the user had just worked on updating recently, was, in fact, "missing" from the SitePlanTree. Why is that a problem, you ask? Well, the page in question, was, in fact, live but could not be placed into the navigation for actual website users to see and navigate to. Don't cross the streams, it would be bad ... don't you know? So, a fully-edited (live) page seemed to be "voided" aka deleted in the SitePlanTree. Umm, someone didn't listen to Egon and apparently crossed the streams! The user wanted to publish this page to the live website, but was not sure if this would adversely affect its placement in the site's navigation. I quickly opened up Support Tools and started running queries. Ultimately leading me to what you see below.
The SitePlanTree is a table constructed with a self join (the red arrows in the image above clearly show this). The NID is related to the NPARENTID. This means if you're looking for the immediate parent of the of your page (the row with oid highlighted in blue) then look for rows in the same table (SitePlanTree) where the NPARENTID of your page is equal to the NID. The query looks something like this:
select * from SITEPLANTREE where NID = (select NPARENTID from SITEPLANTREE where the OID=[the ID that you see in the metadata tab of your Page asset])
You can then just keeping swapping out the oid as you walk up the tree. I wrote a union query to show you the exact tree walk from the "ghost" page up to the root (the row where OTYPE=Publication). You can see the Page's site nav node is "Placed" while its parent is "void" this means everything below the voided Nav node will not show up in the UI (that's the scary bit there). Simply update the "ghost" page's NPARENTID to be equal to root's NID (the row where OTYPE=Publication) AND set the NCODE='UnPlaced" via and sql update. The last step here will be to flush the resultset cache (depicted below) in the Admin UI for this table after doing a direct database update. You can do this by checking the box next to wcsitesDSSitePlanTree and he push the "Clear" button at the top of the list.
There are Monsters in my Closet, Daddy!
Paranormal activity solved, right? Nope, nope, and nope. Was it a ghost that messed with my data, a mischievous squirrel, or an arachnid in the electricals? I was asking myself all of these questions, as well as, "Is my mind playin' tricks on me?" A thorough Knowledge Base search on Oracle's support site revealed that this issue was resolved with version 126.96.36.199.0 (possibly one of the earlier patches) of the product. So, either this bug wasn't resolved in 12c, OR the monster was there in the data (closet) from previous patch levels of the 188.8.131.52.0 version, waiting to pounce on some unsuspecting person sleeping snuggly in their bed. I believe the 184.108.40.206.0 upgrade made this issue "appear" in 12c (as a result of running the Schema Upgrade on the previous db) but is not a WCS 12c issue. For a description of another vairant of this SitePlanTree issue see my colleagues post here. Thankfully this ghost page issue made like a ghost and .... oooo .... disappeared through the living room wall never to be seen again!
If you need any help flushing out gremlins, demons, ghouls, goblins, or monsters from your WCS closet please do not hesitate to contact Function1 (aka the WCS Ghostbusters).
Happy Halloween, my fine-feathered friends!
P.S. I ain't afraid of no ghosts!!!