1. REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Resolved article option "display cover image above article" not saving when editing article

Discussion in 'AMS Support' started by palhanow, Dec 4, 2019.

  1. palhanow

    palhanow Member AMS

    Hello,

    I'm using XF 2.1.4 with the last version of AMS.

    Today after upgrading AMS to the last version, I'm getting a bug after posting a article with a image, checking the option to show as cover.

    I noticed that i had some outdated templates after the upgrade, but corrected after manual merging.

    But when posting the article, no image show as the cover, even checking the option.

    To correct this, i have to manually click on "Set Cover Image" on options and mark the option again and then, the image shows up.

    If i edit the article, the option shows as 'unchecked' again.

    The error on the server log:

    Code:
    InvalidArgumentException: Accessed unknown getter 'cover_image_header' on XenAddons\AMS:ArticleItem[623] src/XF/Mvc/Entity/Entity.php:194
    
    Generated by: POLITZ 4/12/19 às 20:49
    
    Stack trace
    #0 src/XF/Mvc/Entity/Entity.php(106): XF\Mvc\Entity\Entity->get('cover_image_hea...')
    #1 internal_data/code_cache/templates/l3/s9/public/xa_ams_article_edit.php(341): XF\Mvc\Entity\Entity->offsetGet('cover_image_hea...')
    #2 src/XF/Template/Templater.php(1315): XF\Template\Templater->{closure}(Object(SV\AdvancedBbCodesPack\XF\Template\Templater), Array)
    #3 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('xa_ams_article_...', Array)
    #4 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
    #5 src/XF/Mvc/Dispatcher.php(418): XF\Mvc\Renderer\Html->renderView('XF:ArticleItem\\...', 'public:xa_ams_a...', Array)
    #6 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
    #7 src/XF/Mvc/Dispatcher.php(360): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
    #8 src/XF/Mvc/Dispatcher.php(53): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
    #9 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
    #10 src/XF.php(390): XF\App->run()
    #11 index.php(20): XF::runApp('XF\\Pub\\App')
    #12 {main}
    
    Request state
    
    array(4) {
      ["url"] => string(153) "/ams/supermercados-registram-aumento-de-5-78-nas-vendas-para-outubro-abras-justifica-pela-liberacao-do-fgts-aumento-de-credito-e-queda-dos-juros.623/edit"
      ["referrer"] => string(176) "https://forum.politz.com.br/ams/supermercados-registram-aumento-de-5-78-nas-vendas-para-outubro-abras-justifica-pela-liberacao-do-fgts-aumento-de-credito-e-queda-dos-juros.623/"
      ["_GET"] => array(1) {
        ["/ams/supermercados-registram-aumento-de-5-78-nas-vendas-para-outubro-abras-justifica-pela-liberacao-do-fgts-aumento-de-credito-e-queda-dos-juros_623/edit"] => string(0) ""
      }
      ["_POST"] => array(0) {
      }
    }
    If you need the link for the last article posted:

    Supermercados registram aumento de 5,78% nas vendas para outubro | ABRAS justifica pela liberação do FGTS, aumento de crédito e queda dos juros
     
  2. Bob

    Bob Developer Staff Member

    The field 'cover_image_header' was renamed in AMS 2.1.9 to 'cover_image_above_article'.

    That ERROR is caused by an outdated FILE or an outdated/improperly merged template. My GUESS since you said you had outdated templates and solved them by MERGING, that the MERGE was not performed correctly and that OLD template code is still in use (hence why its looking for 'cover_image_header' when it should be looking for 'cover_image_above_article').

    If you know how to SEARCH templates, search for 'cover_image_header' (without the ' tick marks). The search SHOULD come up empty..... if not and the search brings up any template results, that means the template has been modified and does not have the new changes applied that NEED to be included in the template. You might have to revert those templates so that they are 100% STOCK AMS (which ensures that they are the way they are supposed to be with the NEW changes) and then reapply any customization (preferably via TM's (template modifications) instead of direct template edits).

    These are the FOUR AMS templates that had CHANGES made to them in regards to setting the display of the Cover Image above the Article (the field that stores the boolean value was renamed, so template edits had to be made).

    Selection_999(036).png

    If you do a template search on the term 'cover_image_header', it should come up with "No results found". If it comes up listing any of the above templates, that means those templates are either OUTDATED or were improperly merged.

    If you do a template search on the term 'cover_image_above_article', it should list those four templates. If not, then I would suggest reverting those four templates so that they are AMS 2.1.9 STOCK and then re-applying any customizations to them.
     
    Last edited: Dec 5, 2019
  3. palhanow

    palhanow Member AMS

    Oh man,

    You are a genius.

    Problem solved.

    Just searched for 'cover_image_header' in the templates and replaced by 'cover_image_above_article'.

    One template was outdated with the name: 'xa_ams_article_edit'. Edited and done.

    Problem solved.

    I always get confused when merging the templates.

    BTW, if you drink alcoholic drinks, i can send you a gift from Brazil, a typical drink ("Cachaça") around here as a little gift for thanking you for all the job you do for us.

    If you don't drink, I'm sure that we can find anything you like on our country.

    Thank you very much, again.
     
    Last edited by a moderator: Dec 5, 2019
    Bob likes this.
  4. Bob

    Bob Developer Staff Member

    lol...yes, so do I sometimes. The wording of the phrases seems a bit confusing.
     
    Kairete likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.