Publishing Field encoding extra “?” questionmark charecters (actually acsii 8203 zero width space )

Assume that you have created a new article page then Typed some string in Page Content.
After Selected this content and make it bold.
Then clicked the
HTML Source.-> In html source we see following looks no unusual charecter in it .
<p><strong>sharepoint</strong></p>

But if we copy this string tsource to another program for example notepad++ We can see “?” <p><strong>sharepoint</strong>?</p> …. or if you run following powershell:

$site = get-spsite http://contoso
$web = $site.OpenWeb()
$list = $web.Lists[“Pages”]
$page = $list.GetItemById(<ItemId>)
$page[“Page Content”]

Result is same :<p><strong>sharepoint</strong>?</p>

+It is happen only when the first page created and saved.
+Issue happen when we reach data with OM or copy paste outside of the SharePoint to another advanced text editor program.

Similar :http://social.msdn.microsoft.com/Forums/sharepoint/en-US/23804eed-8f00-4b07-bc63-7662311a35a4/why-does-sharepoint-put-in-character-code-8203-in-a-richtext-field?forum=sharepointdevelopment

You may face this issue Both SharePoint 2010 and Sharepoint 2013

Unfortunately this is by design . The “Page Content” field or Publishing HTML Fields uses RTE (Rich text editor). RTE sometimes adds zero width space (&#8203) as a workaround to ensure cursor range selection is correct in some browsers. When viewing “HTML Source”, browser HTML doesn’t render zero width space character. But after copying the string out,like notepad++ and powershell renders it as an unknown character (?). It is rare condition and not happen always and depends many various factors But if you have facing this
For a resolution, you may need use some custom codes for remove that charecter in related string.
String.Replace(  ((char)8203).ToString(), “” );

Content Type Publishing does not publish SPD reusable workflow along with Content Type for SharePoint 2010

Content type Publishing will include workflow associations, but not the workflow themselves. It is by design , In SharePoint 2010, Content Type Publishing will include the workflow association, however the actual workflow is not published. To work around this behavior, workflows should be manually created or transferred to the site before the Content Type and workflow association are published.

Does SharePoint Server 2010 SP2 has also contains SharePoint Foundation 2010 SP2 updates ?

The answer is  YES

Unlikely the previous SP1s of the SharePoint If you have a SharePoint Server 2010 installation , just installing SharePoint Server 2010 SP2 is enough,
You dont need to install SharePoint Foundation 2010 SP2 first.

For more information about SP2 please check my previous article.
https://blog.bugrapostaci.com/2013/07/23/sharepoint-2010-sp2-has-been-released/

 

How to remove “Open this webpart page in maintenance view” message

Assume following scenario

1. Add wiki page in wiki page library
2. edit properties of this page, there is an message

“Open this web part page in maintenance view to delete the problem web parts and remove the personal settings.”

at the bottom of the editing property page.

wmm0

this message is usually a false alarm but it can make users annoying. You can remove this message by using JQuery easily.

  1. Integrate the Jquery with your master page.
    http://blogs.msdn.com/b/yojoshi/archive/2010/06/17/using-jquery-with-sharepoint-2010.aspx
  2.  Go to the related Library Settings -> Advanced Settings.
  3. And select “Launch forms in a dialog” option to “no” and click ok.That would provide to open dialog boxes as a page and you can use the ribbon to change edit mode of the editform.aspx page.

    wmm1

  4. Find the item in the library and Click edit Properties
    wmm2
  5. Click Site Actions -> Edit Page while EditForm.aspx in browsing.
    wmm3
  6. Add a “Content Editor” web part to related Document Libraries’ EditForm.aspx
    wmm4
  7. Click HTML-> Edit HTML Source
    wmm5
  8. Type following Script inside of the HTML Source Windows.

    <script type=”text/javascript”>
    $(document).ready(function() {
    $(“a:contains(‘Open Web Part Page’)”).parent().css(‘display’,’none’);
    });
    </script>

    wmm6

  9. Click OK and Save the page. IF everyhing is ok you shouldn’t able to see the WebPartMaintenace Message like below.

    wmm7

  10.  Go to the related Library Settings -> Advanced Settings.
  11.  And select “Launch forms in a dialog” option to “YES” for revert back and click ok

How to ensure the SharePoint 2010 workflows end in given period

Many question has been asked about this problem.

in SharePoint Best Practices;

* For performance consideration ; you have to plan your timer jobs will always finish on time.
* You need to choose appropriate schedule interval to do it.

But this is not suitable for every condition ; Let me give some information about the issue.

You have planing to develop a custom timer job  for example this job has responsible to get some remote data from a remote System in 1 minute interval .
And what if the remote operation has taken more than 60sec. or what if that the timer job has faced with some problems and not getting finished itsjob in given period. You got the idea 🙂

In some conditions ; you may need to ensure no matter what ,the timer job has to be finished its job in given period . and If doesnt , you may want to terminate the running instance of the timer job and start a new instance of it.

The problem is here ;

If a timer has over its period and continue to running ; After the period has elapsed the new instance wont be started by  default behaviour of the SharePoint.
In SharePoint there is no way to run  two instance of a same timer job definition at same time

And even you have implemented some control logic in that timer job which responsible for the check and terminate if previous instance has running to stop it. It doesnt work because the timer job code wont be run again so it is never step through the SPTimerJob.Execute() method one more time.

And there is no way in OOB configuration to provide this functionality.

Resolution;

Resolution of this problem is easy but tricky. First you need to have 2 timer job.

EnsureTimerJobFinished

1)  Controler Timer job: (Scheduled) Has responsible to run worker timer job in defined interval and responsible to timing. (if the worker timer job has still running it can kill the previous one and start a new instance)

2)  Worker Timer Job. (Once) : Does the execute actual operation.

3)  If the Controler has detected that the previous instance of the worker timer job still running. It can terminate it. (Or you can extend your solution and make your own decision here)

4) After termination , The Controller can run another instance of the worker timer job.