function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Derek M HughesDerek M Hughes 

Unable to access page - to list KB articles

Hi,

This one has be properly stumped.  I've spent hours on my own and with a colleague troubleshooting this and with trial and error have been able to reproduce this on a very simple page with a simple controller, but still cannot determine the root cuase or the solution.  Any assistance would be appreciated.

The use case is ultimately a customised site for a pulic knowledge base.  One feature will be to display articles that have been marked as features using a custom picklist field on the article object.  The article type is "Support Article" so the object is support_article__kav.

Here is the controller that queries the object and returns a list of artcles that are featured:
public class TestPageController 
{
    // method to return a list of support articles that have the field Featured="Yes"
    public static list<Support_Article__kav> FeaturedArticles  {
        get {
            if	(FeaturedArticles == null) {
                FeaturedArticles = 
                    [
                        SELECT Id, KnowledgeArticleId,Title
                        FROM 
	                        Support_Article__kav
                        WHERE 
                            Featured__c 	= 'Yes' AND 
                            PublishStatus	= 'online' AND 
                            language		= 'en_US' 
                        LIMIT 10
                    ];
            }
            return FeaturedArticles;
        }
    }    
}
This is rendered on the following VisualForce page (as a simple list for purposes of illustration of the problem:
<apex:page controller="TestPageController" sidebar="false" showHeader="false" docType="html-5.0" standardStylesheets="true">
    
    <h1>Featured Articles</h1>
    <ul>
        <apex:repeat var="fa" value="{!featuredArticles}">
            <li>
                <a href="{! URLFOR($Action.KnowledgeArticle.View, LEFT(fa.KnowledgeArticleId,15)) }">
                    {!fa.title} (ID={!fa.KnowledgeArticleId}) 
                </a>
            </li>  
        </apex:repeat>
    </ul>

</apex:page>
When this page is displayed (https://c.cs17.visual.force.com/apex/test_page) it results in the following error:

Unable to Access Page
The value of a parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information. 

Now for the very strange extension of the problem.  If I add another article list to the page using <knowledge:articleList> which displays 10 articles in similar list then the whole page (BOTH LISTS) display correctly:
<apex:page controller="TestPageController" sidebar="false" showHeader="false" docType="html-5.0" standardStylesheets="true">
    
    <h1>Featured Articles</h1>
    <ul>
        <apex:repeat var="fa" value="{!featuredArticles}">
            <li>
                <a href="{! URLFOR($Action.KnowledgeArticle.View, LEFT(fa.KnowledgeArticleId,15)) }">
                    {!fa.title} (ID={!fa.KnowledgeArticleId}) 
                </a>
            </li>  
        </apex:repeat>
    </ul>
    
    <!-- If you add the articlelist below, the page WORKS CORRECTLY. Remove it and the page fails. --> 
    <h1>All Articles</h1>
    <ul>
        <knowledge:articleList articleVar="article" pageSize="10" > 
            <li>
                <a href="{! URLFOR($Action.KnowledgeArticle.View, article.id) }">{!article.title}</a> (ID={!article.Id}) 
            </li>  
        </knowledge:articleList>
    </ul>
    
</apex:page>
The above code samples are complete and compile in my org.

I am desparate from some solution to this.

Thanks in advance
Derek


 
ShashankShashank (Salesforce Developers) 
I tried to replicate thte issue but it is not happening for me. Are you still facing this issue? Is it still only intermitttent with the above example?