Customer Portal

Get Involved. Join the Conversation.


    Mirela Iepure
    Fatal error "Class 'Custom\Widgets\chat\Url'...
    Topic posted May 13, 2015 by Mirela IepureBronze Medal: 1,250+ Points 
    784 Views, 26 Comments
    Fatal error "Class 'Custom\Widgets\chat\Url' not found"


    I created a new widget with chat function for our Technical Support team to answer the tech questions from customers. Unfortunately when I stage the changes made in Customer Portal I get this error:

    Fatal error: Class 'Custom\Widgets\chat\Url' not found in /cgi-bin/***.cfg/scripts/cp/generated/staging/staging_01/optimized/views/headers/home.php on line 1178 

    Can you help me make the changes where are needed so that the new chat widget could be functional?

    Thank you,


    • Mirela Iepure

      Can someone help me with this situation?

      Thank you.

    • Jessica Bradley

      Hi Mirela,

      It's best to open a service request with Customer Care and provide the fatal error information.


    • Ryan

      Mirela -

      Does your widget function properly in Development?  Do you encounter this error during the staging process?  If so, you may try re-initializing your staging environment to clear any potential conflicts.  Note that this will completely wipe your Staging directories and re-create them from Development.


    • Mirela Iepure


      I don't think the restaging is gonna help me. The fact that I created a new widget with chat function I think means that there should be made some connections with the actual website and I don't know which should I do. Unfortunately the Customer Care is not very helpful..


    • Ryan

      Mirela -

      Please see my other questions above, clarify when/where you're seeing this error, and include steps to reproduce. 


    • Mirela Iepure

      I created the new widget named ChatforTech like the ConditionalChatLink_custom widget. I also created separate pages for chat_launch and chat_landing and pages askTech and ask_confirmTech on which is the form applied in case there aren't agent available for chat.

      I staged all the changes in Customer Portal and got the error.

      Does it mean that I haven't defined the class 'Custom\Widgets\chat\Url' in the widget definition?


    • Anuj Behl

      Hi Mirela,

      I will be repeating Ryan's question. Before staging the changes, did you test it in development area? Did it work there?


    • Barrilito van Dijk

      Hi Mirela,

      As you have made custom pages/widgets you should be sure wether it works in the development mode. I don't see the answer to that question in this thread yet. Furthermore, it helps if you point out wether you are using CP2 or CP3 and perhaps the version of Service Cloud (RightNow). It helps even more if you can clarify the setup of your pages and widgets, or perhaps share some coding. It seems as if you have missed something in your code, or a typo. So, please share more so that people can help you out.



    • Mirela Iepure

      Hi Barrilito,

      I kind of new to this all Oracle system but I don't think is working either in the development mode. Please let me know what code do you want me to send you.

      Thank you,


    • Barrilito van Dijk

      Hi Mirela,

      You don't think it works... what does that mean? It either works or not...

      If you are not sure what you are doint and/or to check if it works, it is hard for us to help out.

      The error you see relates to the home.php.  As you are the one making the customizations, I expect you to know which pages or widgets are cusomtized. You could share the pages where you made changes. Try to share those pages and code and try to explain what it is you are doing or what you want it to do, I think perhaps someone can helpout then.

      Good luck.


    • Mirela Iepure


      So what I did was to create from zero the widget like the actual chat widget (ConditionalChatLink_custom) and replace the name with ChatForTech.

      The widget structure contains the following files:

      I also created the redirect pages for the chat forms in which the customers can introduce their contact information and questions. I named the files askTech.php and ask_confirmTech.php These files were creared based on the ask.php and ask_confirm.php which are related to the ConditionalChatLink_custom widget

      The home.php code is:

      <rn:meta title="#rn:msg:SHP_TITLE_HDG#" template="standard.php" clickstream="home"/>
      <div id="rn_PageTitle" class="rn_Home">
          <div id="rn_SearchControls">
              <h1 class="rn_ScreenReaderOnly">#rn:msg:SEARCH_CMD#</h1>
              <form onsubmit="return false;">
                  <rn:container report_id="100251">
                  <div class="rn_SearchInput">
                      <rn:widget path="search/AdvancedSearchDialog" additional_filters="industries" report_page_url="/app/answers/list"/>
                      <rn:widget path="search/KeywordText" label_text="#rn:msg:FIND_THE_ANSWER_TO_YOUR_QUESTION_CMD#" initial_focus="true"/>
                  <rn:widget path="search/SearchButton" label_button="Search &#9658;" report_page_url="/app/answers/list"/>
      <div id="rn_PageContent" class="rn_Home">
          <rn:widget path="search/ProductCategoryList" data_type="categories" label_title="#rn:msg:FEATURED_SUPPORT_CATEGORIES_LBL#"/>
          <div class="rn_Module">
              <rn:widget path="reports/Multiline" report_id="194" per_page="12"/>
              <a class="rn_AnswersLink" href="/app/answers/list#rn:session#">#rn:msg:SEE_ALL_POPULAR_ANSWERS_UC_LBL#</a>

      Please let me know what other coding you need for helping me out.

      Thank you,



    • Barrilito van Dijk

      Hi Mirela.

      Thank you for the extra info. Unfortunately I can not help you further with the info I see.

      The fatal error says:

      Fatal error: Class 'Custom\Widgets\chat\Url' not found in /cgi-bin/***.cfg/scripts/cp/generated/staging/staging_01/optimized/views/headers/home.php on line 1178

      This looks like you have a custom widget called "Url" which is placed in a "chat" folder. But in the code you shared I don't see a widget in the home page calling it. Did you change the standard.php template and is it called there perhaps? You said you build the widget from scratch. Why not copy the existing chat widget and changing that one?

      Sometimes it is hard to help if the basics are missing a little. At this point I can only help you out by advising you to go back to some basics to see what works. If you have changed a template, put back the original one from the reference implementation. Do the same for your home.php and try to replace your custom widget by a standard one. Things may still not work, but if the error dissapears, you know where it comes from.

      In general, the error is simpel, you defined a class somewhere whic is not there, so I think you are refering to a widget which is not there, or part(s) of your widget have the wroing classname defined. The classname should have the same name as your widget. Perhaps some difference in the use of capitols?

      Hope this helps you in the right way a little... Good luck!

    • Mirela Iepure

      Hi Barrilito,

      Here is how the standard.php template looks like when I call the new widget ChatForTech:

      <!DOCTYPE html>
      <html lang="#rn:language_code#">
      <rn:meta javascript_module="standard"/>
          <meta charset="utf-8"/>
          <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
          <!--[if lt IE 9]><script src="/euf/core/static/html5.js"></script><![endif]-->
          <rn:widget path="search/BrowserSearchPlugin" pages="home, answers/list, answers/detail" />
          <rn:theme path="/euf/assets/themes/standard" css="site.css,
              {YUI}/panel/assets/skins/sam/panel.css" />
          <link rel="icon" href="" type="image/png"/>
      <body class="yui-skin-sam yui3-skin-sam">
      <div id="rn_Container" >
          <div id="rn_SkipNav"><a href="#rn_MainContent">#rn:msg:SKIP_NAVIGATION_CMD#</a></div>
          <div id="rn_Header" role="banner">
              <rn:widget path="utils/CapabilityDetector"/>
              <a target="_blank" href=""><div id="rn_Logo"><span class="rn_LogoTitle">#rn:msg:SUPPORT_CENTER_LBL#</span></div></a>
              <div id="rn_LoginStatus">
                  <rn:condition logged_in="true">
                          <rn:field name="Contact.LookupName"/><rn:condition language_in="ja-JP">#rn:msg:NAME_SUFFIX_LBL#</rn:condition>
                          <rn:field name="Contact.Organization.LookupName"/>
                      <rn:widget path="login/LogoutLink"/>
                  <rn:condition_else />
                      <rn:condition config_check="PTA_ENABLED == true">
                          <a href="javascript:void(0);" id="rn_LoginLink">#rn:msg:LOG_IN_LBL#</a>&nbsp;|&nbsp;<a href="javascript:void(0);">#rn:msg:SIGN_UP_LBL#</a>
                      <rn:condition_else />
                          <a href="javascript:void(0);" id="rn_LoginLink">#rn:msg:LOG_IN_LBL#</a>&nbsp;|&nbsp;<a href="/app/utils/create_account#rn:session#">#rn:msg:SIGN_UP_LBL#</a>
                          <rn:condition hide_on_pages="utils/create_account, utils/login_form, utils/account_assistance">
                              <rn:widget path="login/LoginDialog" trigger_element="rn_LoginLink"/>
                          <rn:condition show_on_pages="utils/create_account, utils/login_form, utils/account_assistance">
                              <rn:widget path="login/LoginDialog" trigger_element="rn_LoginLink" redirect_url="/app/account/overview"/>
          <div id="rn_Navigation">
          <rn:condition hide_on_pages="utils/help_search">
              <div id="rn_NavigationBar" role="navigation">
                      <li><rn:widget path="navigation/NavigationTab" label_tab="#rn:msg:SUPPORT_HOME_TAB_HDG#" link="/app/#rn:config:CP_HOME_URL#" pages="home, "/></li>
                      <li><rn:widget path="navigation/NavigationTab" label_tab="#rn:msg:ANSWERS_HDG#" link="/app/answers/list" pages="answers/list, answers/detail, answers/intent"/></li>
                      <rn:condition config_check="COMMUNITY_ENABLED == true">
                          <li><rn:widget path="navigation/NavigationTab" label_tab="#rn:msg:COMMUNITY_LBL#" link="#rn:config:COMMUNITY_HOME_URL:RNW##rn:community_token:?#" external="true"/></li>
                      <li><rn:widget path="navigation/NavigationTab" label_tab="#rn:msg:ASK_QUESTION_HDG#" link="/app/ask" pages="ask, ask_confirm"/></li>
      <!--                <li><rn:widget path="navigation/NavigationTab" label_tab="#rn:msg:YOUR_ACCOUNT_LBL#" link="/app/account/overview" pages="utils/account_assistance, account/overview, account/profile, account/notif, account/change_password, account/questions/list, account/questions/detail, account/notif/list, utils/login_form, utils/create_account, utils/submit/password_changed, utils/submit/profile_updated"
                      subpages="#rn:msg:ACCOUNT_OVERVIEW_LBL# > /app/account/overview, #rn:msg:SUPPORT_HISTORY_LBL# > /app/account/questions/list, #rn:msg:ACCOUNT_SETTINGS_LBL# > /app/account/profile, #rn:msg:NOTIFICATIONS_LBL# > /app/account/notif/list"/></li>-->
          <div id="rn_Body">
              <div id="rn_MainColumn" role="main">
                  <a id="rn_MainContent"></a>
              <div id="rn_SideBar" role="navigation">
                  <div class="rn_Padding">
                      <rn:condition hide_on_pages="answers/list, home, account/questions/list">
                      <div class="rn_Module" role="search">
                          <rn:widget path="search/SimpleSearch"/>
                      <div class="rn_Module">
                          <div class="rn_HelpResources">
      <!--                        <div class="rn_Questions">
                                  <a href="/app/ask#rn:session#">#rn:msg:ASK_QUESTION_LBL#</a>
      <!--                    <rn:condition config_check="COMMUNITY_ENABLED == true">
                              <div class="rn_Community">
                                  <a href="javascript:void(0);">#rn:msg:ASK_THE_COMMUNITY_LBL#</a>
                           <rn:condition config_check="MOD_CHAT_ENABLED == true">
                              <rn:widget path="custom/chat/ConditionalChatLink_custom" ignore_preroute="true" min_sessions_avail="1"/>
                          <rn:condition config_check="MOD_CHAT_ENABLED == true">
                              <rn:widget path="custom/chat/ChatForTech" ignore_preroute="true" min_sessions_avail="1"/>
      <!--                        <div class="rn_Contact">
                                  <a href="javascript:void(0);">#rn:msg:CONTACT_US_LBL#</a>
                          <rn:condition config_check="CP_CONTACT_LOGIN_REQUIRED == false" logged_in="true">
                              <div class="rn_Feedback">
                                  <rn:widget path="feedback/SiteFeedback" label_dialog_title="Site Feedback" feedback_page_url="/app/utils/site-feedback/" />
          <div id="rn_Footer" role="contentinfo">
              <div id="rn_RightNowCredit">
                  <rn:condition hide_on_pages="utils/guided_assistant">
                  <div class="rn_FloatLeft">
                      <rn:widget path="utils/PageSetSelector"/>
                  <div class="rn_FloatRight">
                      <rn:widget path="utils/RightNowLogo"/>

      Thank you,

    • Barrilito van Dijk

      Hi Mirela,

      Looking at the template I don't see any issues. It goed to deep to keep on asking you more files and code. I don't have that much time to dive that deep.

      So, I think I can not help out at this level. These are all pretty basic things which you should be able to look into as a rightnow developer, it just takes time and the proper tests. Isn't there any other developer in your company perhaps with some more indept rightnow knowledg that can help you out?  Otherwise perhaps some professional services at Oracle.

      Otherwise perhaps someone else on the forum can still help you. Good luck anyway Mirela!


    • Jeremy Watson


      In either of your chat custom widgets, do you have code in the controller.php files that is 'Url::someFunction'?  If so, you might try adding 'use RightNow\Utils\Url;' to the top of the file or change the function from 'Url::someFunction()' to '\RightNow\Utils\Url::someFunction()'.

      I suspect that you're not referencing the Url class correctly and PHP is then looking for that class in the same namespace as your widget (Custom\Widgets\chat\).