Giter Club home page Giter Club logo

Comments (5)

vlad-ghita avatar vlad-ghita commented on July 28, 2024

Perhaps it's related to #7. I'll re-re-fix it and please check again this one.

from sections_event.

vlad-ghita avatar vlad-ghita commented on July 28, 2024

Ok, now I understood what you're saying. I pushed some local XSLT fixes to version 2.3.2.

  1. Can the validation messages be consolidated into 1 div instead of having 2 divs?

The idea behind sform:formi is to gather data about the status of one entry. It accepts a position parameter which conveniently defaults to first entry. In general, all forms target only one entry in a section. That's why you don't need to set it. But in this case you submit data to multiple entries in one section so you must set this parameter as well. Hands on, Image#2 in your case will incorrectly receive the interpretation from Image#1. The correct way is to call the interpretation for every image like this:

<xsl:variable name="formi-image">
    <xsl:call-template name="sform:formi">
        <xsl:with-param name="section" select="'images'"/>
        <!-- I assume you used the position() function here or something similar -->
        <xsl:with-param name="position" select="position()"/>
    </xsl:call-template>
</xsl:variable>

The idea behind sform:validation-render is to pretty render information about only one entry.

If you want to display a consolidated message for all entries, gather all interpretations from all entries and manually write some code to display appropriate message.

  1. If the entry is edited successfully, it should say so.
  2. Error messages are not showing.

These are the processing stages. All entries go through each stage simultaneously:

  1. Prepare incomming data
  2. Check permissions
  3. Delete entries
  4. Check field data
  5. Set field data
  6. Replace variables
  7. Persist entries to database

In your case, Entry#1 passed Stage#4 but Entry#2 didn't.

The success message is applied to an Entry only if it passes Stage#7.

An appropriate error message is applied to an Entry whenever it fails at one stage.

If any entry fails at any stage, processing is stopped after that stage is completed and current status is returned.

from sections_event.

patrickyan avatar patrickyan commented on July 28, 2024

Thanks for the clarification. The fields for the multiple entries I'm creating are actually being inserted via javascript, so if sform:formi needs to be called for each entry, I can't use it. Even though sform:validation-render only renders messages for one entry, shouldn't it be able to render all messages for all entries by just reiterating over the returned event xml?

I'll check out the updated utilities to see if it addresses the blank divs issue!

from sections_event.

vlad-ghita avatar vlad-ghita commented on July 28, 2024

I'll check out the updated utilities to see if it addresses the blank divs issue!

It won't :)

Even though sform:validation-render only renders messages for one entry, shouldn't it be able to render all messages for all entries by just reiterating over the returned event xml?

No. It's soul job is to render one entry.

If you need to render all entries in given wrapper or something, then ... do it.

Of course there is room for improvement: another sform:validation-render-all template or similar that would do exactly what you're saying, but it's a niche case at the moment. With Symphony Next these ideas will be thought over for good.

from sections_event.

patrickyan avatar patrickyan commented on July 28, 2024

Alright thanks for your thoughts!

from sections_event.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.