2 of 4
2
Odd caching issue with MSM half ready
Posted: 19 May 2008 07:48 AM   [ Ignore ]   [ # 19 ]  
Grad Student
Avatar
Rank
Total Posts:  99
Joined  03-08-2006

More misbehaviour. Similar to the initial problem of the homepage images appearing and disappearing arbitrarily, I’m getting the same thing with the new site’s entries and images. One moment a weblog’s category is displaying all the entries + images that should be available to only the main site. The next moment, it’s correctly displaying only the entries available to the new site without any images.

I’ll rummage about on the wiki now. Thanks smile

 Signature 

Seb Neerman

Profile
 
 
Posted: 19 May 2008 08:33 AM   [ Ignore ]   [ # 20 ]  
Grad Student
Avatar
Rank
Total Posts:  99
Joined  03-08-2006

I followed and implemented the wiki article but it did nothing. I placed the php code in the embed/template for my top navigation (where the category subnav list appears) but they’re sill out of sync. Then I updated a category, and got the same error message and resulting change.

Re the image issue, I’m beginning to suspect that it may be an extension issue, since I’m similarly missing the Geocoding google map for each entry. I have, however, double checked the two extensions that handle the entry images (File 3.11) and gmaps (Geocoding 1.05) and all seems to be in order. Still, it doesn’t explain why they work on the main site, but not the new one.

 Signature 

Seb Neerman

Profile
 
 
Posted: 19 May 2008 08:43 AM   [ Ignore ]   [ # 21 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23547
Joined  05-20-2002

Hm- go create a fresh template- be sure to turn php parsing ‘on’- you do that in the ‘prefs’ for the template group.  You’ll see an option to turn it ‘on’.  Put just the php on there, then view the rendered template.  Any change in row count?

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 19 May 2008 09:00 AM   [ Ignore ]   [ # 22 ]  
Grad Student
Avatar
Rank
Total Posts:  99
Joined  03-08-2006

I created a new template with nothing but the php code in it, and set all the php prefs for it correctly. Viewing it on the front end, obviously returned a blank page. Then I went to check the row count (Admin > Utlilieis > Manage DB tables) and the exp_category_field_data is now 242. It was previously 241. My exp_categories are still 239.

 Signature 

Seb Neerman

Profile
 
 
Posted: 19 May 2008 09:15 AM   [ Ignore ]   [ # 23 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23547
Joined  05-20-2002

Hm- something is ‘off’ db wise.  Generally when it borked, you were missing entries in the field_data table.  Looks like you were maybe missing one anyway- and that got added.  Don’t know why you’d have extras, though.

Did you do any importing- anything like that?  I suspect the cat error is due to the imbalance.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 19 May 2008 09:27 AM   [ Ignore ]   [ # 24 ]  
Grad Student
Avatar
Rank
Total Posts:  99
Joined  03-08-2006

When we first had trouble and I realised that I’d have to re-import the db to restore it I immediately told my client not to add or edit any entries while I sorted it out - or we’d loose it. I’m pretty sure she respected my request. Once restored, I created the new site and it all “seemed” to go according plan. Until of course the image issue cropped up. So the short answer, is no I haven’t imported anything after we restored the db. Nor previously, before I created the new site.

So issues, still outstanding:
– Arbitrarily displaying images and entries from either main site or new site, on the new site.
– New Site (front end) not recognising that I’m logged into the backend
– Category imbalance.

:(

 Signature 

Seb Neerman

Profile
 
 
Posted: 19 May 2008 09:31 AM   [ Ignore ]   [ # 25 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23547
Joined  05-20-2002

Yep- I’ve bumped this up for a further look from the crew.  The not seen as logged in on the frontend of the second site is normal if you’re using the single backend for access.  You need to have a cookie set to be seen as logged in- and the backend doesn’t do a multi-domain login.  Logging into a masked/admin.php on the second site would do the trick.  And there’s a multi-site login for the frontend.  But I don’t think it’s entirely doable via backend.  I’ll double check to be sure.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 20 May 2008 02:17 AM   [ Ignore ]   [ # 26 ]  
Grad Student
Avatar
Rank
Total Posts:  99
Joined  03-08-2006

Thanks Robin for looking into this and getting the second site to recognise members as logged into the system, even though it’s a secondary issue.

I’ve done some more digging about the system and have come across a clue as regards to the image problem in the new site. In the edit screen for the entries’ image Custom Field, the system correctly displays “File” under “Field Type”. However, in the drop down menu for “Select an upload location” I’ve noticed that all the upload locations have been doubled up: 2 x Venue Images, 2 x Venue Pdfs, 2 x Food Images, etc.  The same applies to the edit screen for the main site’s Custom Fields. I’ve tried switching between one duplicated Venue Image and the next on the new site. But it makes no difference.

Also, in contrast to an earlier report, all the images appear to be in the system, ie: I can see them in the Edit screen for each entry (as a thumbnail). Clicking on their respective links takes me to the image. The part that isn’t generated is the {custom_field} call in my templates. The same applies to the Geocoding extension Entry data and {custom_field} template call.

And there’s another oddity. None of my {related} and {reverse_related} entries are working. I’m sorely considering deleting the new site and starting over again. But I realise this is driven by a desire to ‘restart and hope’ rather than work at it, find the real problem and solve it properly.

 Signature 

Seb Neerman

Profile
 
 
Posted: 20 May 2008 09:47 AM   [ Ignore ]   [ # 27 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23547
Joined  05-20-2002

Hm- are you up for giving me superadmin access?  I’d like to go ahead and take a look at it in action.  If that’s doable- pm over the cp url, username and password and I’ll go take a look.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 20 May 2008 10:06 AM   [ Ignore ]   [ # 28 ]  
Grad Student
Avatar
Rank
Total Posts:  99
Joined  03-08-2006

I’d be happy to. Only I’ve just this moment had to turn the site off. My client is sending a media pack out about it and we don’t want anyone having a look at the front end. Give me a few minutes to figure how to htpassword protect the directory so I can safely turn it back on and we can all carry on tinkering with it.

 Signature 

Seb Neerman

Profile
 
 
Posted: 21 May 2008 12:49 AM   [ Ignore ]   [ # 29 ]  
Grad Student
Avatar
Rank
Total Posts:  99
Joined  03-08-2006

Another update re Category MySql errors. I think that during the new site creation process something ‘went wrong’ with the duplication of my custom category fields. I just noticed that none of the content from the main site’s custom category fields were replicated into the new site’s. Updating the new site’s custom_categ fields returns the same category error.

 Signature 

Seb Neerman

Profile
 
 
Posted: 21 May 2008 08:37 AM   [ Ignore ]   [ # 30 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23547
Joined  05-20-2002

Hm- sorry it’s taking me so long.  It’s a bit odd- you’ve got 32 rows of custom fields- 16 for each site.  I assume that’s from a duplication.  But- the field_id number in exp_category_field data only go to id 16.  So basically- none for the second site.  Hence the errors.  And at this point I’m not dead sure if it’s because a copy failed part way or if there’s an actual bug in the MSM.  Or if it WAS a bug that has since been fixed.

Which- is totally not what the initial issue was, but I want to get this sorted.  So- hang tight while I poke code and talk to the crew.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 21 May 2008 08:48 AM   [ Ignore ]   [ # 31 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23547
Joined  05-20-2002

Yea- I’m duplicating the problem with the categories.  Looks like a bug to me- basically, MSM needs to add some fields to the exp_category_field_data table before it copies the data over there.  It isn’t, so you end up with this particular error.

Hang tight while I talk to the crew and maybe see about getting you a quickie fix for it.

And then- I can poke at the original issue wink.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 21 May 2008 09:04 AM   [ Ignore ]   [ # 32 ]  
Grad Student
Avatar
Rank
Total Posts:  99
Joined  03-08-2006

Supa stuff, Robin, thanks. Feeling somewhat flattered I stumbled on a bug.

If you need any other sort of access (FTP, db etc), just yell.

 Signature 

Seb Neerman

Profile
 
 
Posted: 22 May 2008 09:16 AM   [ Ignore ]   [ # 33 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23547
Joined  05-20-2002

OK- the dev crew is poking the bug, let’s see about fixing the tables.  I just tried this on mine and it worked to get the two tables synced back up and the error gone when I edit the categories on the new site.

Before we poke the db directly- be sure to back up the whole database.  Then, I’d backup the exp_category_field_data table individually.  It’s the only one we’re going to poke.

OK- now, this is a little crude.  You have to set two variables:
1. $new_site - should be the id number of the new site you created.  The one that borks.  Hover over the link to the new site- you’ll spot a url like http://media-cow.com/cow-sys/index.php?S=999c5f93&C=sites&site_id=3&page=Qz1PX - which I edited to make smaller.  But basically- the site_id= bit is what you want.  In this case, my id is 3.
2.  $default_fmt - that’s going to stick the format on the category fields.  All mine are none- but put it to whatever.

OK- then create a new blank template, turn php parsing ‘on’ (done in the group prefs for the template group it’s in).  Stick the below on the template, load the page.  Should just come back saying ‘x new field group pairs’ or something.  In my case, it was 1.  In your case, should be 16 I think.

Now- it didn’t copy over any data- so if you have content in the custom fields, you’ll want to edit the categories and copy it over.  This script could be improved on in that regard- but I really wanted to get rid of the error and then poke the rest of the weirdness.  Make sense?  So- backup, run it, let’s make sure you’re now error free.  And then we can try to nail down the initial issue.

<?php
global $DB;

$new_site = 3;
$default_fmt = 'none';
$ids = array();
$i=0;

$sql = "SELECT field_id FROM exp_category_fields WHERE site_id = $new_site";
$query = $DB->query($sql);

    if (
$query->num_rows > 0)
    
{
        
foreach($query->result as $row)
        
{
            $ids[]
= $row['field_id'];
        
}

foreach ($ids as $id)
{
            $DB
->query("ALTER TABLE exp_category_field_data ADD COLUMN field_id_{$id} text NOT NULL");
            
$DB->query("ALTER TABLE exp_category_field_data ADD COLUMN field_ft_{$id} varchar(40) NOT NULL default 'none'");
            
$DB->query("UPDATE exp_category_field_data SET field_ft_{$id} = '".$DB->escape_str($default_fmt)."'");
            
$i++;
}


    }
    
echo $i.' new field pairs';
?>

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 23 May 2008 03:34 AM   [ Ignore ]   [ # 34 ]  
Grad Student
Avatar
Rank
Total Posts:  99
Joined  03-08-2006

That worked a charm, thanks.

I’m not getting anymore Sql Errors when adding or editing categories. FYI , my exp_categories (239) and exp_category_field_data (242) are still off. But it doesn’t seem to be upsetting anyone.

UDPATE…
I’ve just noticed that following the above fix, my Custom Category Fields have all had a number suffixed to their Field Name:

category-subtitle-4
category-meta-desc-3
category-meta-keys-3
(etc)

I don’t have many per category group, so I can easily edit them. But it may be worth noting.

 Signature 

Seb Neerman

Profile
 
 
Posted: 23 May 2008 01:03 PM   [ Ignore ]   [ # 35 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15489
Joined  05-15-2004

Thank you, sneers. Apart from that minor problem, does that take care of you initial issue? Thanks.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 24 May 2008 02:23 AM   [ Ignore ]   [ # 36 ]  
Grad Student
Avatar
Rank
Total Posts:  99
Joined  03-08-2006

The Category issue is resolved.

However, the initial issue I posted about is still lingering. All my entry relative images and geocoding coords are still not playing ball. And there still seems to be some arbitrary crossover between sites: entries that should appear only in the main site occasionally show up in the second site with images (!). When this happens, I visit the “wrong” entries and navigate between them. Then suddenly they disappear and I’m back to seeing only the entries that should be available on the second site, without images. Deeply odd.

 Signature 

Seb Neerman

Profile
 
 
   
2 of 4
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65087 Total Logged-in Users: 35
Total Topics: 82226 Total Anonymous Users: 22
Total Replies: 441924 Total Guests: 213
Total Posts: 524150    
Members ( View Memberlist )