When switching templates, object name and relations options don't change

What’s The Bug?

When switching between templates upon new object creation, object name and relations options don’t change according to the template. See pictures and video attached.

:warning: The bug can be reproduced on Android too.

How To Reproduce It

  • Create multiple templates for an Object Type, eg a Page.
  • Give each template a different name.
  • Add some relations to the template. For example, add Multi-select (aka Tag), Status and Priority. Fill the relations with different options for each template.
  • Feature said relations and/or add them to the canvas.
  • Create a new object and switch back and forth between the templates.
  • Observe that the object name and the relations options don’t change according to the template.

Image or Video



The Expected Behavior

Object name and relations options should change to the values set in each template.

Device

PC

OS

Fedora Linux 40

Anytype Version

0.42.0

Network Mode

AnySync

Technical Information

OS version: linux x64 6.9.12-200.fc40.x86_64
App version: 0.42.0
Build number: build on 2024-07-31 08:28:58 +0000 UTC at #4a8c39e4e991d3e9d6819f5ff495c688415bc288
Library version: v0.35.0-rc12
Anytype Identity: A7kLNo65RFUGs8dZab3DBxrHYDJ6FrszGdSzks9GYXgfiqLc
Analytics ID: ABCxkJgcj9adfaQyFuWM8m9oQpDWV7fa9GSdAeWM1fFf18VZ
Device ID: 12D3KooWFQYbQzNkGxVqp1wZ1ctbZ3S97uu16MmaKvVcAAxZavPb

Looks like issues with template selector.


Note that applying template to existing object is a feature request that is in planning stage.

Dang, I missed that topic. I did search before posting, but I couldn’t find it. I think it’s because that topic’s tagged as a feature request :eyes:.

Anyway, for relations it looks like it’s the same issue, thanks for the link! The object name issue is not mentioned though.

I can’t reproduce this issue. The new Object adopts the name of the Template.

I can consistently reproduce it. Happens in every Space and with every Type.

Here’s another video recording of the bug. I’m in a newly created Space with a newly created Type:

I also checked on Android and I can reproduce it there as well:

I also thought that maybe my account, being made in the early Alpha days, got messed up for some reason.

So I created a new account… same issue:

Tech info of the new account for proof:

OS version: linux x64 6.9.12-200.fc40.x86_64
App version: 0.42.3
Build number: build on 2024-08-02 12:17:02 +0000 UTC at #e1e3c496021c87ea0488f4a9eba8836e61a01072
Library version: v0.35.0
Anytype Identity: A6cUnx6LGs3DibPhoykAphVBFFu59vtpq1PuygZJKFm5gJhR
Analytics ID: 54d5b82e-d93e-4cab-832b-849c80ae4da6
Device ID: 12D3KooWHmA7gE2pUcvhUKWtXwpb3bMC5RE9G1FEPgJpgZhjLSeV

@boots I don’t think this is a bug, existing objects don’t adapt to new templates. I thought you were referring to newly created Objects.

We are working on this feature now though.

I’m not sure why you’re bringing up existing objects, I never mentioned them.

I always talked about newly created objects. It’s also in the first line of the first post: “upon new object creation”.

Anyway, if the “Apply template to existing object” feature will solve all this, you can close the topic. Cheers.

I am experiencing the same issue as the OP. I am creating a new Object using a Type with multiple Templates. So, this isn’t an issue with applying a Template to an Existing Object.

This topic was erroneously marked as ‘solved’. It is not solved and persists in version 43.8

I too am experiencing precisely the same issue. On top of the OP, I will add few more observations:

Upon creating a new object, the default template gets applied. If you change the template (before making any change to the object) then:

  • source object field (in relations window) will correctly show the template you switched to
  • Any new relations, fields, text, etc you added to the template will also switch

What will NOT switch:

  • icon
  • cover
  • tag

Note: this is most definitely a bug. And easily reproducible too.
For the moment, one CANNOT assign ANY new template as default EXCEPT the ‘blank one’. From the blank default one, you have precisely one time the choice of choosing a template and all properties will be correctly ‘assigned’ (inherited or whatever you call it behind the scenes - templates and types in anytype are incredibly confusing, TBH)

If you make any template but the blank one default, then upon creation of the object, it will assign this new template correctly, but you cannot chose another template without the bug rearing up.

The fix for the moment is to:

  • keep ‘blank’ as default template
  • if you chose another template and it was the wrong one, you must delete the object and start again

Oh and it would be awesome to be able to delete the ‘blank’ template too as it takes valuable space, necessitating scrolling for the right template if you have more than 1.

Because the current functionality is that once content is populated to an object, the object is considered as existing object.

This is definitely not ideal and practical for note taking but this is the current design in Anytype. That’s why a lot of people upvote for template feature requests.

In the meantime, try using different default templates at different object creation points, e.g. template A in set, template B in cmd+n.

I disagree.
Specifically - if you click on new object and DO NOTHING to the object, you can continue switching templates. The minute you type something in the object, the option to switch templates goes away. THAT is what you are talking about.

What I and others are talking about is that while you do not touch the object, you can switch templates. And the way the templates are switched is buggy. As I explained precisely, the ‘source object’ in the relations window actually switches to the chosen template - which goes against what you are saying. But several fields do not switch along.

I can understand this issue in general is being worked on. The reason I am stressing this is because this is clearly a bug - you cannot have half the fields switch as you switch the template and other half do not switch. And the reason I am pushing this bug is PRECISELY because devs are likely working in that area, so now is an excellent time likely to make devs aware of this bug

If nobody re-opens this bug today I will file a new bug

Hope it is clearer?

I can definitely see your frustration. I am also coping with this type of behaviour and so do many fellow community members.

You would definitely “feel” an object becoming an existing object when you type something into the object. But the brain doesn’t feel like re-selecting a preferred template is the amendment of an existing object.

However, the content of relation also contributes to the definition of an existing object. The auto application of template (as in applying the default template) would still populate the relation content onto the object, and this makes the object into an existing object.

  • This definition is necessary because we can have “Empty” objects which doesn’t contain any text for naming of the object but still exist because of a relation.
  • For example, with date objects (also not fully actualised), even if we don’t have any text on a date, the date still exists.
  • Of course, if we have build title from relation, we might be able to release this definition.

As a side note, the current template system is definitely not ideal, but I personally prefer team to investigate in implementing new system which empower template even further and also solve these problems. See some ideas on template e.g. Live template or modular retrieval system with relational data model.

Thank you for your thoughts. I will look at the links you provided with interest. Cheers

@UnwokeNetizen In the latest Town Hall, Anton said that “primitives” are on the roadmap for season 1 of 2025.

In other words, the “apply template to existing objects” we’re waiting for seems to be finally coming :raised_hands: