Priority in Shops collection always 999 instead of 1 - Bug?


#1

Hello

If I do my own Shop.json I want to configure the different templates to use my custom layoutHeader and layoutFooter.

So I added many entries to the Shops.json like this and the entries are imported correctly, but always with priority 999 instead of priority 1. If I change the value to priority 1 with Robomongo, it works like expected. Am I doing something wrong or doesn’t it work? Could not find anything in the documentation about priority and position.
{
“layout”: “coreLayoutBlabla”,
“workflow”: “coreWorkflow”,
“collection”: “Products”,
“theme”: “default”,
“enabled”: true,
“structure”: {
“template”: “productsLanding”,
“layoutHeaderBlabla”: “layoutHeaderBlabla”,
“layoutFooterBlabla”: “layoutFooterBlabla”,
“notFound”: “productNotFound”,
“dashboardControls”: “dashboardControls”,
“adminControlsFooter”: “adminControlsFooter”
},
“priority”: 1,
“position”: 1
},


#2

Hi @jakudaba.

The switch from 1 to 999 is not a bug. It’s one of the updates in the more recent releases.

Essentially, the change from a default value of 1 to 999, is to enable you to be able to override default templates. So in your case, make sure to explicitly specify a priority field (to any value lower that 999) in your shop data. This will ensure that the new default of 999 is not used for you. It’ll also ensure that your own template is used instead of any default ones (999).

You can see the description in this PR for more detail.

About the docs not helping out in this case, that is being worked on, and will get fixed shortly. Apologies for inconveniences that it might have caused.


#3

Update: Here’s mention of it in the docs. https://docs.reactioncommerce.com/reaction-docs/development/plugin-layouts-3 (down on the page)


#4

Hi @impactmass

Thank you very much for your reply.

Yes, I did that. I put in my Shop.json all my custom configs according to the layout with priority 1.
I also changed for testing purposes the value position: 2 which is also not correctly imported. It seems my value in my Shop.json is always overwritten by 999 and 1 in for the field position. Why that? I am doing a reaction reset -n.


#5

Hi… Apologies… I missed your response here… has this been resolved? I’ll try find some time today to fully test out what you’re experiencing


#6

Hi Seun

No worries. I was away for some time because of an accident. So many things in reactioncommerce changed, I need to reorientate myself first with all the version changes. My plugin doesn’t work at all anymore. Looking for a reactioncommerce developer who can help me realizing some plugins. Can you help me with that?

Best regards… Manu