Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author Johann Heyne

    (@jonua)

    I′m sorry for this nasty problem. And yes, please drop me some JSON data of before and after the migration. This would help me to get quick into it.

    Thanks!

    Plugin Author Johann Heyne

    (@jonua)

    I′m sorry for this nasty problem. And yes, please drop me some JSON data of before and after the migration. This would help me to get quick into it.

    Thanks!

    Thread Starter martijnn94

    (@martijnn94)

    Hi,

    Thanks for your help!

    The correct structured JSON:

    Image of backend: https://i.imgur.com/N1D3ij0.png

    {"p":{"o":{"uh":1}},"c":{"0":{"p":""},"1":{"p":""}},"h":{"0":{"c":"Technische gegevens"},"1":{"c":""}},"b":{"0":{"0":{"c":"Minimale / Maximale opspan inwendig"},"1":{"c":"14” – 56”"}},"1":{"0":{"c":"Maximale band breedte\t"},"1":{"c":"1.220 mm"}},"2":{"0":{"c":"Maximale band diameter"},"1":{"c":"2.450 mm"}},"3":{"0":{"c":"Vermogen"},"1":{"c":"1,5 kW"}},"4":{"0":{"c":"Maximaal gewicht band / wiel"},"1":{"c":"1.100 kg"}},"5":{"0":{"c":"Maximale kracht afdruk rol"},"1":{"c":"25.500 N"}}}}

    Correct JSON (linted):

    {
    	"p": {
    		"o": {
    			"uh": 1
    		}
    	},
    	"c": {
    		"0": {
    			"p": ""
    		},
    		"1": {
    			"p": ""
    		}
    	},
    	"h": {
    		"0": {
    			"c": "Technische gegevens"
    		},
    		"1": {
    			"c": ""
    		}
    	},
    	"b": {
    		"0": {
    			"0": {
    				"c": "Minimale / Maximale opspan inwendig"
    			},
    			"1": {
    				"c": "14” – 56”"
    			}
    		},
    		"1": {
    			"0": {
    				"c": "Maximale band breedte\t"
    			},
    			"1": {
    				"c": "1.220 mm"
    			}
    		},
    		"2": {
    			"0": {
    				"c": "Maximale band diameter"
    			},
    			"1": {
    				"c": "2.450 mm"
    			}
    		},
    		"3": {
    			"0": {
    				"c": "Vermogen"
    			},
    			"1": {
    				"c": "1,5 kW"
    			}
    		},
    		"4": {
    			"0": {
    				"c": "Maximaal gewicht band / wiel"
    			},
    			"1": {
    				"c": "1.100 kg"
    			}
    		},
    		"5": {
    			"0": {
    				"c": "Maximale kracht afdruk rol"
    			},
    			"1": {
    				"c": "25.500 N"
    			}
    		}
    	}
    }

    The wrongly structured JSON after migration:

    Image of backend: https://i.imgur.com/pbS8HOh.png

    {"p":{"o":{"uh":1}},"c":[{"p":""},{"p":""}],"h":[{"c":"Technische gegevens"},{"c":""}],"b":[[{"c":"Minimale \/ Maximale opspan inwendig"},{"c":"14\u201d \u2013 56\u201d"}],[{"c":"Maximale band breedte\t"},{"c":"1.220 mm"}],[{"c":"Maximale band diameter"},{"c":"2.450 mm"}],[{"c":"Vermogen"},{"c":"1,5 kW"}],[{"c":"Maximaal gewicht band \/ wiel"},{"c":"1.100 kg"}],[{"c":"Maximale kracht afdruk rol"},{"c":"25.500 N"}]]}

    Wrong JSON (linted):

    {
    	"p": {
    		"o": {
    			"uh": 1
    		}
    	},
    	"c": [{
    		"p": ""
    	}, {
    		"p": ""
    	}],
    	"h": [{
    		"c": "Technische gegevens"
    	}, {
    		"c": ""
    	}],
    	"b": [
    		[{
    			"c": "Minimale \/ Maximale opspan inwendig"
    		}, {
    			"c": "14\u201d \u2013 56\u201d"
    		}],
    		[{
    			"c": "Maximale band breedte\t"
    		}, {
    			"c": "1.220 mm"
    		}],
    		[{
    			"c": "Maximale band diameter"
    		}, {
    			"c": "2.450 mm"
    		}],
    		[{
    			"c": "Vermogen"
    		}, {
    			"c": "1,5 kW"
    		}],
    		[{
    			"c": "Maximaal gewicht band \/ wiel"
    		}, {
    			"c": "1.100 kg"
    		}],
    		[{
    			"c": "Maximale kracht afdruk rol"
    		}, {
    			"c": "25.500 N"
    		}]
    	]
    }

    Seems like the ID’s of the rows are missing?

    Thanks

    Plugin Author Johann Heyne

    (@jonua)

    Thanks. This problem in based on an misconception on mine. JSON only allows a string to be a key, but I used digits like “0” as key′s. So the migration tool fix this. Unfortunately, my code is not prepared for this. So I′m trying to fix this in the next release. But December is as usually a busy month for me. I try to get my hands on in the next 24 hours.

    Thread Starter martijnn94

    (@martijnn94)

    You are awesome! If you need any help with something, please let me know!

    Plugin Author Johann Heyne

    (@jonua)

    I just finished a patch version of the plugin, that uses the correct JSON format to read and save data but also can read the previously used format. It needs some tests know and then I would ask you, if you can try the new version before I role it out.

    Thread Starter martijnn94

    (@martijnn94)

    Epic, so it also reads the by a migration malformed data?

    Of course I would like to test, do you have the plugin available on Github or something? Will try first thing tomorrow!

    Plugin Author Johann Heyne

    (@jonua)

    https://github.com/johannheyne/acf-table/tree/_masters/free
    Please make a backup of your database before you test the new version.
    Replace your plugin files with the files in the folder /advanced-custom-fields-table-field/trunk/

    Plugin Author Johann Heyne

    (@jonua)

    And yes, it should also reads the by a migration “malformed” data.

    Thread Starter martijnn94

    (@martijnn94)

    Hi,

    Was just testing this out, seems to be working perfectly. I’m going to push to acceptiation in a few moments to also test on non-malformed data!

    Thread Starter martijnn94

    (@martijnn94)

    Just pushed to production and everything seems fine! I’ll have the client play with it to see if something goed wrong, but I dont think it will.

    Thanks again for your fast help!

    I can confirm that this is actually also part of fixing this old issue (which turned out not to be server-related at all, now).
    https://www.ads-software.com/support/topic/fields-being-deleted-on-save?replies=6

    We had to dig up the project again this week, and make adjustments to it, then migrate it to test and live – And it was causing the exact issue, again.

    I installed 1.1.5, and tried a new migration to test. All tables are intact.

    Plugin Author Johann Heyne

    (@jonua)

    Thanks!

    I’ll have to take back that confirmation – Yes, it does work when migrating from my local to test (Digital Ocean) server – But going live (not a Digital Ocean server) is not migrating the tables correctly, unfortunately.

    I don’t want to hijack another thread though, just a heads up.

    Plugin Author Johann Heyne

    (@jonua)

    Can you please give me a sample snippets of the table data in the database before and after migration?

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Destroyed JSON data structure’ is closed to new replies.