Announcement

Collapse
No announcement yet.

Update fields to blank field - what Qualifies it to make it blank?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Update fields to blank field - what Qualifies it to make it blank?

    what signature does Miva Merchant look for to update a field to blank from having content?

    In Miva 4 - to update an existing field to be blank, it required putting a 'non-character' (like a single space) into the field and updating - simply having a blank field for update did not work.

    I believe now that having a blank field actually updates the DB field to blank - is this correct? Does anybody else think that this is dangerous for merchants in updating data? I do.

    I'm just curious, because I had a serious 'mis-hap' that we recovered from and I believe that this may have been the cause - this cannot be determined for certain.

    Your help is appreciated.

    Tim Bogus
    Tim Bogus

    #2
    Re: Update fields to blank field - what Qualifies it to make it blank?

    you need to put "something" in the field like a dash,

    Comment


      #3
      Re: Update fields to blank field - what Qualifies it to make it blank?

      I don't feel that this is the case - I'm believing that if I simply have a blank cell that it overwrites the contents of the field - this is without any character in the 'cell'.

      Would this qualify as a bug?

      Curious...

      Tim Bogus
      Tim Bogus

      Comment


        #4
        Re: Update fields to blank field - what Qualifies it to make it blank?

        Hi all. I'd like to bump this up for clarification.

        I currently use the syntax of
        Code:
        <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:generic_field>&mvt:product:customfield_values:customfields:generic_field;<br><br></mvt:if>
        to display custom fields.

        however, if I follow Red's instructions and - say - using a space I replace - technically there is something in the field - and it is no longer null - according to Miva Merchant.

        Is there a way to 'null out' a custom field without manual entry or rejigging my conditionals?

        Thanks y'all.

        Tim Bogus
        Tim Bogus

        Comment


          #5
          Re: Update fields to blank field - what Qualifies it to make it blank?

          define 'null out'. I didn't think that Miva was able to handle nulls properly. My understanding is that NULL to Miva is '' (an empty string, or a string with a length of 0).

          Also, Red said to use a dash. I believe Miva would look at a space as an empty string. (In fact I just checked it and space gets trimmed to an empty string, which then returns an error.)

          I'm not 100% sure I understand what you're trying to accomplish so I can't help you further, but I don't see how having a blank field in the database would cause any harm as long as you were able to handle it properly upon retrieval.

          Comment


            #6
            Re: Update fields to blank field - what Qualifies it to make it blank?

            Originally posted by Brandon MUS
            define 'null out'. I didn't think that Miva was able to handle nulls properly. My understanding is that NULL to Miva is '' (an empty string, or a string with a length of 0).
            When I say 'null out' I basically mean just that - take a field that contains text or something (ISNULL = FALSE) and remove all text (ISNULL = TRUE).


            Originally posted by Brandon MUS
            Also, Red said to use a dash. I believe Miva would look at a space as an empty string. (In fact I just checked it and space gets trimmed to an empty string, which then returns an error.)
            Yes, Brandon - this is what I thought. I can I first ask you a question: Did you do this manually or via a flat-file import?

            You are right if you manually update a field with a single space it will 'null out' the field - [I]however[I] - if you upload a space into a custom field it will not null out the field. (ISNULL != TRUE)

            Originally posted by Brandon MUS
            I'm not 100% sure I understand what you're trying to accomplish so I can't help you further, but I don't see how having a blank field in the database would cause any harm as long as you were able to handle it properly upon retrieval.
            We 100,000+ products. I am unable to manually go through 1000 products and put a single space into a custom field. In this case, we've found that importing flat files is our only method to do stuff. Any chance that there is a method to null out fields using flat file imports?

            Thanks you all - much appreciated!

            Tim Bogus
            Last edited by tbogus; 01-22-08, 06:27 AM.
            Tim Bogus

            Comment


              #7
              Re: Update fields to blank field - what Qualifies it to make it blank?

              Ah, okay, I understand now. When I did my "test", I tried putting a blank space in a required customer field (from the customer view). I believe the problem you are experiencing could be considered a Miva bug. If I had to guess, I would say that the field validation is not consistent through the different methods for adding/updating fields (eg. they use certain functions on bulk upload that they do not use on the edit screens).
              If this is a one-time launch of products, you should probably use "." and then go to your API backend (MivaSQL or MySQL) and update all of the instances of your custom field where = '.' to = '' (make sure not use NULL here as I don't believe MivaSQL can handle true NULL values).

              Your other option is to add to your conditional, where (isNULL OR == '.'), and use . to replace the empty string.

              Comment


                #8
                We got this to work for custom fields. If you select under Import Products from Flat File, If you select "Custom Product Field Settings" And select "Delete Existing Data When Imported Data is Empty" and select "Update Existing Products" under "Import Product Settings - Existing Products" it works.

                Thanks to Miva support for the recommendation and we tested it and then implemented it.

                Comment

                Working...
                X