tag:blogger.com,1999:blog-1961817584554893389.post7317880539365361475..comments2023-04-03T14:36:43.956-04:00Comments on Just in time learning: SPListItem provided is not compatible with a Publishing PageWing-Leung Chanhttp://www.blogger.com/profile/12516537821073412766noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-1961817584554893389.post-88475709409840044552015-03-18T15:24:50.319-04:002015-03-18T15:24:50.319-04:00It's been a long time since I looked at this. ...It's been a long time since I looked at this. Off the top of my head, perhaps your $web object is stale? Maybe try getting it again with $web = Get-SPWeb $web.Url and do the second update?Wing-Leung Chanhttps://www.blogger.com/profile/12516537821073412766noreply@blogger.comtag:blogger.com,1999:blog-1961817584554893389.post-78490320331533521852015-03-18T14:59:10.869-04:002015-03-18T14:59:10.869-04:00Hello. Great Post! this solution worked on one of ...Hello. Great Post! this solution worked on one of the sites but not working on another:( After calling first $web.Update() I get following error:<br />Exception calling "Update" with "0" argument(s): "Item has already been added.<br />Key in dictionary: 'H?↑' Key being added: 'H?↑'"<br />At line:1 char:12<br />+ $web.Update <<<< ()<br />+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException<br />+ FullyQualifiedErrorId : DotNetMethodException<br /><br />Any ideas? Anonymoushttps://www.blogger.com/profile/13893635742959699812noreply@blogger.comtag:blogger.com,1999:blog-1961817584554893389.post-55515205228441602562013-11-05T09:50:23.463-05:002013-11-05T09:50:23.463-05:00This worked a treat, added it to a powershell scri...This worked a treat, added it to a powershell script that was auto creating sites from templates :)<br /><br />Si (uk)Anonymoushttps://www.blogger.com/profile/02499199095311260853noreply@blogger.comtag:blogger.com,1999:blog-1961817584554893389.post-14060684199024233722013-10-19T23:37:07.929-04:002013-10-19T23:37:07.929-04:00What are the values of $web and $correctId?What are the values of $web and $correctId?Wing-Leung Chanhttps://www.blogger.com/profile/12516537821073412766noreply@blogger.comtag:blogger.com,1999:blog-1961817584554893389.post-61560918874148278152013-10-16T10:50:39.243-04:002013-10-16T10:50:39.243-04:00When running $web.AllProperties["__PagesListI...When running $web.AllProperties["__PagesListId"] = $correctId.ToString()<br />I receive an error "You cannot call a method on a null-valued expression"<br /><br />Any ideas?Kennynoreply@blogger.comtag:blogger.com,1999:blog-1961817584554893389.post-44033392019163199992013-09-13T10:58:53.097-04:002013-09-13T10:58:53.097-04:00Debjit, I too appreciate your contribution, it sol...Debjit, I too appreciate your contribution, it solved my problem.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1961817584554893389.post-25262861395984396552013-06-11T13:12:42.688-04:002013-06-11T13:12:42.688-04:00Debjit thanks this also solved my problem instantl...Debjit thanks this also solved my problem instantly. I've been struggling with about 30 sites experiencing the same issue.Logan Branjordhttps://www.blogger.com/profile/06343181915986874480noreply@blogger.comtag:blogger.com,1999:blog-1961817584554893389.post-39648286356307956832013-04-10T10:19:54.521-04:002013-04-10T10:19:54.521-04:00Thanks a lot, Debjit! Spent a day on this until I ...Thanks a lot, Debjit! Spent a day on this until I found your post.Lukashttps://www.blogger.com/profile/09539518758474717071noreply@blogger.comtag:blogger.com,1999:blog-1961817584554893389.post-74545729445888981232013-03-08T03:01:16.688-05:002013-03-08T03:01:16.688-05:00Many thanks from me as well! Just helped me solve ...Many thanks from me as well! Just helped me solve the same issueRenehttp://modery.netnoreply@blogger.comtag:blogger.com,1999:blog-1961817584554893389.post-46404643700201682092013-01-17T04:35:53.432-05:002013-01-17T04:35:53.432-05:00Very nice na?Very nice na?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1961817584554893389.post-68161959103823338742012-11-23T01:46:01.121-05:002012-11-23T01:46:01.121-05:00You mad my day Debjit.. Thanks I am searching for...You mad my day Debjit.. Thanks I am searching for this for so many timesAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1961817584554893389.post-68680338242586704532012-06-11T07:30:50.846-04:002012-06-11T07:30:50.846-04:00Try this
$web = get-spweb http://site-collectio...Try this <br /><br /><br />$web = get-spweb http://site-collection/path-to-affected-site<br />$correctId = $web.Lists["Pages"].ID<br />$web.AllProperties["__PagesListId"] = $correctId.ToString()<br />$web.Update()<br /><br />$web.AllProperties["__PublishingFeatureActivated"] = "True"<br />$web.Update()Debjitnoreply@blogger.comtag:blogger.com,1999:blog-1961817584554893389.post-22300959177547054652012-05-29T18:25:01.001-04:002012-05-29T18:25:01.001-04:00Any news on this issue yet?Any news on this issue yet?GeekBoyhttps://www.blogger.com/profile/00402595283004663964noreply@blogger.com