Jump to content

Batch Child Editor


adrian

Recommended Posts

@virtualgadjo - does that error happen every time you try to unpublish them all or did it only happen once like this?

Is "weekendatbinnys-champagne-tasting" a field or child page name?

Is ID 1019 a language page?

 

 

Link to comment
Share on other sites

Hi @adrian

it happens every time i tried (actually, the first time, it was my client who ran into the error and called me asking what he could have done wrong ? )
even both ways, publishing and unpublishing, after having added my custom admin action and i tried many times before and after

"weekendatbinnys-champagne-tasting" is a page name name1019 the default language name of the page (website with six languages...)
i've tried changing the name in english but, same result

of course every child page has a different name but the name is only set in the default one (english), running

select count(name1019) as dups, name1019
from pages group by name1019 having count(name1019) > 1

returns an empty result

what's funny is that the website is now 5 years old and the client has already used the batch child 4 times without any alert (i've tried with the last release of your module but it didn't change anything)
what was interesting to me was that once i've unpublished all the children with my action, trying to publish them back, i only worked with the hidden one, no displayed error but funny result... and it's the first time the client hid some pages during the events announcement without unpublishing them, up to this year he just unpublished the events before launching the next harvest ?

have a nice day

Link to comment
Share on other sites

I'm at a bit of a loss at the moment - I can't replicate the original error and I can't replicate any weirdness with hidden page behaving differently when publishing/unpublishing. I feel like it's due to something in here: https://github.com/adrianbj/BatchChildEditor/blob/9cdf3b7f317d9f8c07bc75faf150e5ba9490dfb6/BatchChildEditor.module.php#L1348-L1355 but not really sure why if page titles / names aren't being changed at the time you are unpublishing. Can you check to see if this section of code is being called and maybe dump the value of $name for all the child pages in the loop to see if there are indeed any duplicates at this point?

  • Like 1
Link to comment
Share on other sites

Hi @adrian
thanks a lot for the tip; i'll have a close look at this piece of code but right now, having a look at this name/title thing i may have an idea
those page are created by the api when validating an event and each one has a different name but ha has used the same title for many events and it looks like language names, well, the default language one in fact, in changed after the page title and the creating duplicates before running the action

i will try restoring the original db but unchecking the overwrte page name checkbox to see if it changes something

that's where the admin custom action doesn't run into any issue as it just targets the template, no matter the names, titles or whatever else...

have a nice day

Link to comment
Share on other sites

Hi again @adrian,

just tested it, i restored the db, unchecked this overwrite names checkbox

and... it worked! it was looking at the snippet you pointed me to that i had this idea, thanks again ? ? 

have a nice day

  • Like 1
Link to comment
Share on other sites

Hi @virtualgadjo - I am glad unchecking the overwrite names option solved things for you. I dug into that section of code and discovered an issue with duplicate titles (when both set during a batch update) and fixed that in the latest version. I don't think this change will help what you were seeing - I think that is something ML that I haven't been able to reproduce, but at least I found and fixed something else :)

  • Like 1
Link to comment
Share on other sites

Hi @adrian

i'm happy to "hear" my little post was at least useful for something ?
i thought the issue i ran into was due to those pages with the same title and no names for 5 out of 6 languages but couldn't really understand where to dig more...

i'll update the module in the website but you know, i'll keep my custom admin action as for the client, he won't have to wonder about all the other columns meaning and will continue to use the batch child editor he really likes to export a csv of all those pages and keep track of its events historry ?
this way, whatever he does with those "pages", targeting their ids won't be impacted

i'm must say those pages are a little special as i don't need a name for each language, they are pages as everything in pw but actually mode data sets i use to fill a json where to get a leaflet map markers position and popup big content and even if i create those page with a really unique name, if ever he changes their title and, why not, names afterwards even if not useful, it may generate the problem you've just fixed

thanks again and a lot for your time and help (and of course modules ? )

have a nice day

Link to comment
Share on other sites

  • 5 months later...

Hi @adrian. Is there any reason why, in the batch child editor, 'edit' opens in a modal but 'view' opens with a new tab. I would prefer consistency (with view opening in a modal) and have done a simple hack to replace the link (target="_blank") with a modal link (class="pw-modal") but obviously that is not a good answer. I appreciate that changing it might upset others (and there may be a good reason why you did that way). Perhaps it could be configurable (panel, modal , new) as in the main page edit?

Link to comment
Share on other sites

Hi @MarkE - this was all done a long time ago before the pw-modal class was available, but the key reason a modal makes sense for editing is that any changes you make while editing in the modal are applied immediately in the row of child page in the table of children once the modal is closed, so I don't think it makes any sense to have different window opening options for editing. 

But for viewing pages, I always thought that would be better in a new tab, but I suppose a modal or panel might be preferred sometimes, so what about this solution which matches the default behavior of PW's page list action buttons by allowing you to open in a modal with a long click, but still open in a new tab so you don't accidentally lose any changes to other pages in the child editing table?

$cp->viewable() ? ' <a class="pw-modal pw-modal-large pw-modal-longclick" href="'.$cp->httpUrl.'" target="_blank"><i style="cursor:pointer" class="fa fa-eye"></i></a>' : '',

Just playing around with this and for some reason the pw-panel class doesn't work, but pw-modal does. Maybe it's not being loaded for some reason in modules.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...