Giter VIP home page Giter VIP logo

Comments (19)

martinheise avatar martinheise commented on July 1, 2024 1

@NightJar:
Brief rundown of the steps to upgrade:
I did follow the upgrade guide converting an old project, using mainly the single standard steps of uprgade-code. As the project was a bit messy I had to include some manual cleanup of composer requirements etc., including adding the removing old widgets module and adding the requirement to composer.json. But nothing directly database-related.
Unfortunately I did notice the issue quite late when reworking my templates, so there could have been some editing etc. in the meantime.

Especially I didn’t touch the Widgets manually - the state mentioned in my previous post was the result of the normal upgrade and dev/build command.
Also it was the same for all pages, even some quite sure I didn’t touch.
(I’m curious if the issue is a bug inside the widgets module at all or rather in the Core).

More results from yesterday:

  • Simple republishing of pages didn’t solve the issue
  • Found then that the Version field of all WidgetArea records was set to 0

So this is how I could solve it for me finally:

  • Setting all WidgetArea/Version fields to 1 by SQL
  • call publishRecursive() on all staged WidgetArea records (maybe republishing the pages would have worked now)

from silverstripe-widgets.

grandcreation avatar grandcreation commented on July 1, 2024 1

Is there any way to temporary fix it? i cannot publish the page having custom widgets anymore :(

from silverstripe-widgets.

ScopeyNZ avatar ScopeyNZ commented on July 1, 2024 1

Was having exact same issue i.e widgets (within blog) only showing with .../?stage=Stage, for me updating blog module fixed this, was using "silverstripe/blog": "^3.0@dev" - updated to "silverstripe/blog": "dev-master" and widgets now show properly.

Hmmmn. I'm trying to understand why that would fix the issue and I can't figure out why... I agree with @NightJar that it seems like something that Versioned should be able to do on dev/build - When you add Versioned to some DataObject then it should create published versions of all the records. I'll do some more investigation and raise an issue on silverstripe-versioned.

from silverstripe-widgets.

rvowles avatar rvowles commented on July 1, 2024

This is exactly the problem I am facing for all our widgets.

from silverstripe-widgets.

robbieaverill avatar robbieaverill commented on July 1, 2024

Thanks. I’ve raised the impact level.

from silverstripe-widgets.

rvowles avatar rvowles commented on July 1, 2024

We've got a call in with one of your account managers over this, its blocking our migration... Just to close the loop if they ask you :-)

from silverstripe-widgets.

martinheise avatar martinheise commented on July 1, 2024

I have the same issue. Some insights:

  • The Widgets themselves are published correctly (records in Widget_Live etc.)
  • but the WidgetArea of the page not published, Table WidgetArea_Live is empty.
  • Creating a new page works including adding of widgets, WidgetArea is published.

So it probably looks like a migration issue with the has_one relation to the WidgetArea.

from silverstripe-widgets.

NightJar avatar NightJar commented on July 1, 2024
  • but the WidgetArea of the page not published, Table WidgetArea_Live is empty.

Hi @muppsy007 - can you please confirm this case with your custom widget; is it the only widget on the page?

but I can't find it when comparing to the Readme example.

@muppsy007 Could you also please indicate whether you mean the Readme on this module, or perhaps one of the guides on migrations, etc?

from silverstripe-widgets.

NightJar avatar NightJar commented on July 1, 2024

@muppsy007
@rvowles
@martinheise
You have all mentioned or alluded to this issue arising out of a recent upgrade to SilverStripe 4.
Can you please give a brief rundown of the steps you've taken to upgrade this module?

@martinheise in particular you have made mention that all the widgets have published, could you please specify if you did this manually (whether via a build task or SQL query) or the system did it automatically for you on dev/build after upgrading?

@muppsy007 The steps you have described about signing in and out of the CMS simply change the viewing mode (as does ?stage=Stage) - this indicates to me that things are simply not published. @martinheise has confirmed my suspicions with his added info. Pre-SS4 neither Widget nor WidgetArea were Versioned - meaning that edits were instantly live. Now they are both Versioned, and ownership ($owns) is set up correctly. As a work around (or a fix, if you don't have too many pages with widgets) simply publishing the page should solve the issue for you in the meantime.

We would like to improve the migration experience however and address this on upgrade - as everything was 'always live' before there should be no issue in publishing both Widgets and WidgetAreas (however publishing pages automatically is dangerous as draft content generally should not be considered as OK to be live at the time of upgrade).

This may be as simple as making appropriate notes in the Readme - so it would be very helpful if you could all please provide feedback about your upgrade steps and experience :)

from silverstripe-widgets.

rvowles avatar rvowles commented on July 1, 2024

from silverstripe-widgets.

NightJar avatar NightJar commented on July 1, 2024

Thanks @rvowles
Can you please tell me if you are using this module in conjunction with silverstripe/blog, or stand-alone on a custom Page type?
And how is it that your automated migration runs?

from silverstripe-widgets.

rvowles avatar rvowles commented on July 1, 2024

from silverstripe-widgets.

NightJar avatar NightJar commented on July 1, 2024

Thank you @rvowles
Sorry could you please also advise me whether the Widgets themselves are published or unpublished after running the dev/build?
I'm having trouble tracking down what could be performing this action. There does not appear to be any build task or migration script associated anywhere in silverstripe/widgets.

from silverstripe-widgets.

rvowles avatar rvowles commented on July 1, 2024

from silverstripe-widgets.

NightJar avatar NightJar commented on July 1, 2024

Interesting, thank you for the feedback @martinheise

While I certainly think it is possible to create a build task in this module to run after a code upgrade is complete in order to set the versioning to a correct state to begin with, I feel like there should be a feature for this in the core (possibly silverstripe/versioned) that allows for this kind of action as surely this isn't the only module affected.

It sounds like any object that was not versioned that becomes versioned will have issues adapting to that change. I think it would be cool if some of the core team could weigh in on this issue and give their thoughts - @robbieaverill @tractorcow @dhensby perhaps, as I know these people have dealt with versioning before.

My proposed solution would be to introduce a hook for e.g. Versioned that would run on a dev/build (akin to requireDefaultRecords) that would detect the absence of any versions in the ${DataObjectTable}_Versioned table, and automatically publish (recursively) the first version. This I think would be safe as previously to becoming versioned any update was instantly 'live', in a similar fashion to thinking of it as "permanently published".

from silverstripe-widgets.

groundnation avatar groundnation commented on July 1, 2024

Was having exact same issue i.e widgets (within blog) only showing with .../?stage=Stage, for me updating blog module fixed this, was using "silverstripe/blog": "^3.0@dev" - updated to "silverstripe/blog": "dev-master" and widgets now show properly.

from silverstripe-widgets.

robbieaverill avatar robbieaverill commented on July 1, 2024

@ScopeyNZ

I'll do some more investigation and raise an issue on silverstripe-versioned.

Did this happen? I think we can move this to a versioned issue, I don't think it should be fixed here

from silverstripe-widgets.

ScopeyNZ avatar ScopeyNZ commented on July 1, 2024

I haven't raised an issue but I do think it's a generic "adding versioned to something should create a published version of all those things". Something that should live on Versioned. I'll try to get around to putting some time to put my thoughts together in an issue today.

from silverstripe-widgets.

ScopeyNZ avatar ScopeyNZ commented on July 1, 2024

Ok I've raised an issue... A few days after I said I'd try too 😅 ...

silverstripe/silverstripe-versioned#215

I'll close this in favour of that. Thanks all for the discussion!

from silverstripe-widgets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.