spicywebau / craft-neo

A Matrix-like field type for Craft CMS that uses existing fields
Other
403 stars 63 forks source link

Attempting to save an element in an unsupported site #436

Closed MattWilcox closed 3 years ago

MattWilcox commented 3 years ago

Description

We have a multi-site with two Site Groups. All Entries in the Pages section are available in a second language for all Groups. The Neo field is set to save blocks to other sites in the same site group - this should mirror content between languages isolated to each Group.

Some pages in this section, when saved, are not propagating the content. This can be seen by the errors below, where certain pages report Attempting to save an element in an unsupported site.

As far as I can tell, there is no difference between pages that work, and ones that do not... Additionally the Test Page is an example that has every possible Neo sub-field populated, so any error I'd expect to see on that page, and not only on other pages within the Section.

$ ./craft resave/entries --section pages
Resaving 69 entries ...
    - [1/69] Resaving Test Page (39) ... done
    - [2/69] Resaving Test sub page (573) ... done
    - [3/69] Resaving Test sibling sub page (579) ... done
    - [4/69] Resaving Test sibling page (576) ... done
    - [5/69] Resaving Test Entry Type (611) ... done
    - [6/69] Resaving Spotlight (1379) ... done
    - [7/69] Resaving Information for Parents & Guardians (3706) ... error: Attempting to save an element in an unsupported site.
    - [8/69] Resaving Why Choose College (2469) ... done
    - [9/69] Resaving Friendly & Welcoming Environment (3120) ... done
    - [10/69] Resaving Excellent Student Support (3672) ... done
    - [11/69] Resaving State-of-the-Art Facilities (3267) ... done
    - [12/69] Resaving Enrichment Opportunities (5440) ... done
    - [13/69] Resaving Outstanding Results (2472) ... done
    - [14/69] Resaving Courses (5659) ... error: Attempting to save an element in an unsupported site.
    - [15/69] Resaving A Levels (20299) ... done
    - [16/69] Resaving Coleg Glynllifon (Agriculture) (20338) ... done
    - [17/69] Resaving Personal Learning Account (20284) ... done
    - [18/69] Resaving Student Life (5662) ... error: Attempting to save an element in an unsupported site.
    - [19/69] Resaving Student Support Hub (7054) ... done
    - [20/69] Resaving Student Support (18237) ... done
    - [21/69] Resaving Financial Support (18726) ... done
    - [22/69] Resaving Course Fees (55006) ... done
    - [23/69] Resaving Term Dates for Learners (18132) ... done
    - [24/69] Resaving College Transport (19412) ... done
    - [25/69] Resaving Period Dignity (19476) ... done
    - [26/69] Resaving Coleg Cymraeg Cenedlaethol (19710) ... done
    - [27/69] Resaving ADTRAC (20089) ... done
    - [28/69] Resaving Gym & Sports Academies (7481) ... done
    - [29/69] Resaving Academi Llandrillo: Rugby (17846) ... done
    - [30/69] Resaving Academi Llandrillo: Football (18018) ... done
    - [31/69] Resaving Academi Menai: Football (18119) ... done
    - [32/69] Resaving Cafes & Restaurants (7801) ... done
    - [33/69] Resaving Library and Learning Resource Service (17599) ... done
    - [34/69] Resaving Student Union (8047) ... done
    - [35/69] Resaving Active Ambassador (7908) ... done
    - [36/69] Resaving Apply Now (5463) ... error: Attempting to save an element in an unsupported site.
    - [37/69] Resaving Already applied? (5472) ... done
    - [38/69] Resaving How to apply for a full-time course (5466) ... done
    - [39/69] Resaving How to apply for a part-time course (5478) ... done
    - [40/69] Resaving How to apply for a degree course (5481) ... done
    - [41/69] Resaving About Us (20567) ... error: Attempting to save an element in an unsupported site.
    - [42/69] Resaving Policies (21091) ... error: Attempting to save an element in an unsupported site.
    - [43/69] Resaving Data Protection Act 2018 (GDPR) (39747) ... done
    - [44/69] Resaving Welsh Language Standards and Policy (39890) ... done
    - [45/69] Resaving Higher Education Policies and Procedures (40725) ... done
    - [46/69] Resaving Equality & Diversity (21076) ... error: Attempting to save an element in an unsupported site.
    - [47/69] Resaving Cookies (20753) ... done
    - [48/69] Resaving Privacy Notice (20740) ... done
    - [49/69] Resaving Governance (39583) ... done
    - [50/69] Resaving Staff and Learners (40850) ... done
    - [51/69] Resaving Public (30608) ... error: Attempting to save an element in an unsupported site.
    - [52/69] Resaving Restaurants (33839) ... done
    - [53/69] Resaving Hair and Beauty Salons (36883) ... done
    - [54/69] Resaving Conference Facilities (37832) ... done
    - [55/69] Resaving Sports Facilities (38680) ... done
    - [56/69] Resaving Contact Us (44993) ... error: Attempting to save an element in an unsupported site.
    - [57/69] Resaving Specialist Services (46051) ... done
    - [58/69] Resaving Funding (47863) ... error: Attempting to save an element in an unsupported site.
    - [59/69] Resaving Skills for Employers & Employees (SEE) (48027) ... done
    - [60/69] Resaving Work Ready (48119) ... done
    - [61/69] Resaving ReAct - Redundancy Action Scheme (48170) ... done
    - [62/69] Resaving Jobs Growth Wales (48237) ... done
    - [63/69] Resaving Knowledge Transfer Partnership (KTP) (48296) ... done
    - [64/69] Resaving Apprenticeships (48409) ... error: Attempting to save an element in an unsupported site.
    - [65/69] Resaving Find an Apprentice (46378) ... done
    - [66/69] Resaving Traineeship (54758) ... done
    - [67/69] Resaving Degree Apprenticeships (54853) ... done
    - [68/69] Resaving Higher Apprenticeships (54908) ... done
    - [69/69] Resaving Graduation (55581) ... error: Attempting to save an element in an unsupported site.
Done resaving entries.

Steps to reproduce

  1. Save a page containing a Neo field that should propagate content to other sites in the same Group
  2. It doesn't, for some pages, though they are of the same Entry Type and in the same section as working pages.

Other information

Minimal web.log (cleared out, save of a single failing page)... web.log.zip

Composer.json... composer.json.zip

MattWilcox commented 3 years ago

Follow up... If I go to a broken page in the CMS, and change the Language to the "other" language where the expected Neo content is missing... and does not get replicated: I can add content there, save... and that new content is properly propagated over to the "original" language... but also wipes out everything in the original language's Neo field. From that point on, however, replication between the two works as it should. You just have massive data loss on that intial save that jolts things back to working.