Block not saving on Concrete5 version 8 (GlobalArea)
Permalink Browser Info Environment
I'm trying to add a custom menu to some global areas, the blocks get added to the area correctly but then, after settingt the pages i want to show and save, seems like it doesn't get save and thus no pages are displayed.
I'm afraid the problem is with version 8 (note that during installation i had an issue due to save function declaration, i just had to comment "array" on the declaration of block controller).
Thanks in advance.
I'm afraid the problem is with version 8 (note that during installation i had an issue due to save function declaration, i just had to comment "array" on the declaration of block controller).
Thanks in advance.
Type: | Discussion |
---|---|
Status: | In Progress |
Hi,
I fixed the code on my own (actually it's just a few small changes, but the debug took hours), if you want I can send you my changes
I fixed the code on my own (actually it's just a few small changes, but the debug took hours), if you want I can send you my changes
Hi,
I'm sorry you had to go to all that trouble. I would like to see the
changes you made and I'll apply them in the next version for Concrete
version 8 and mention you in the changelog ;).
I'm currently backpacking for a year and I have a laptop with me but often
don't have internet to work. I'll be in Auckland the next 5 days and will
see if I can work on my add-ons.
They modified the core in Concrete version 8 and it's not a small thing
because the return types of a lot of methods have changed for objects like
User, File, Package, etc due to Doctrine implementation. That violates the
open/closed principle of software design. I take great care in writing
solid, clean code and suddenly I find all my add-ons broken due to version
8.
Regards,
Justin
On Jan 5, 2017 11:40 PM, "concrete5 Community" <discussions@concretecms.com>
wrote:
I'm sorry you had to go to all that trouble. I would like to see the
changes you made and I'll apply them in the next version for Concrete
version 8 and mention you in the changelog ;).
I'm currently backpacking for a year and I have a laptop with me but often
don't have internet to work. I'll be in Auckland the next 5 days and will
see if I can work on my add-ons.
They modified the core in Concrete version 8 and it's not a small thing
because the return types of a lot of methods have changed for objects like
User, File, Package, etc due to Doctrine implementation. That violates the
open/closed principle of software design. I take great care in writing
solid, clean code and suddenly I find all my add-ons broken due to version
8.
Regards,
Justin
On Jan 5, 2017 11:40 PM, "concrete5 Community" <discussions@concretecms.com>
wrote:
Hi!
sorry for the delay, basically I changed \Src\Page\PageList function as follow
the issue is due to new Doctrine as you said, they added a check with an exception (now i don't remember exactly where).
Beside this lost order and it's not the best (i know this) but at least it works.
And this only work for 1 level menus, subpages still not working but for the moment it's ok for me. Hope to hear news soon.
Thanks
sorry for the delay, basically I changed \Src\Page\PageList function as follow
public function __construct(\Concrete\Core\Search\StickyRequest $req = null) { parent::__construct($req); // Setup our join; only returns pages that are save to the page picker pages table //$this->query->from("Pages","p"); $this->includeSystemPages = true; //$this->query->leftJoin('p', Controller::PAGES_TABLE, 'ppp', 'ppp.cID = p.cID')->orderBy('ppp.position', 'ASC'); }
the issue is due to new Doctrine as you said, they added a check with an exception (now i don't remember exactly where).
Beside this lost order and it's not the best (i know this) but at least it works.
And this only work for 1 level menus, subpages still not working but for the moment it's ok for me. Hope to hear news soon.
Thanks
That's weird. That's part of the sql query builder. I'm not getting the bug
and can add nested pages. I need some more information to debug the
problem.
Can you give me the exception message you are getting? That's our first
clue. It could be a MySQL error.
On Jan 11, 2017 4:18 AM, "concrete5 Community" <discussions@concretecms.com>
wrote:
and can add nested pages. I need some more information to debug the
problem.
Can you give me the exception message you are getting? That's our first
clue. It could be a MySQL error.
On Jan 11, 2017 4:18 AM, "concrete5 Community" <discussions@concretecms.com>
wrote:
Hi
I am having this issue but with multilingual pages.
I have a en-gb site tree and an en-us site tree.
When I pick pages from the en-gb site tree within a en-gb Global Area it works fine.
BUT when I try to pick pages within a en-us Global Area it doesn't save the pages I have picked.
Please help :)
Thanks
Jack
I am having this issue but with multilingual pages.
I have a en-gb site tree and an en-us site tree.
When I pick pages from the en-gb site tree within a en-gb Global Area it works fine.
BUT when I try to pick pages within a en-us Global Area it doesn't save the pages I have picked.
Please help :)
Thanks
Jack
Hi Jack,
I'm sorry to hear you are having problems with my add-on. Do you have any error message?
To be clear on what's happening: you have a global area and on the en_US section you added the page picker and added pages from the that same language tree? And these are not showing. Is that correct? I will need try to reproduce the error by doing what you did so I can see what's going on.
I'm sorry to hear you are having problems with my add-on. Do you have any error message?
To be clear on what's happening: you have a global area and on the en_US section you added the page picker and added pages from the that same language tree? And these are not showing. Is that correct? I will need try to reproduce the error by doing what you did so I can see what's going on.
Hi Jack,
I managed to reproduce the bug. Very strange, as you say it works with the default language tree but not with the other language. I haven't figured out yet why. I could be a bug in my code or it could have something to do with how the Multilanguage code works. I'm currently looking at the database query.
I will keep you up to speed. I hope to fix it this weekend.
I managed to reproduce the bug. Very strange, as you say it works with the default language tree but not with the other language. I haven't figured out yet why. I could be a bug in my code or it could have something to do with how the Multilanguage code works. I'm currently looking at the database query.
I will keep you up to speed. I hope to fix it this weekend.
I think I figured out what's going on. If you add pages from a different language/locale section than the page it's displayed on then the pages won't show. You have to select the correct language first in the dropdown above the sitemap. I noticed when the sitemap dialog comes up it does not show the pages for the current language you are on but for the default language. This can be confusing.
I'm not sure this qualifies as a bug because it makes sense you don't want to show pages from the wrong language (the database query makes use of the default Concrete5 page list query). But I do think this all leads to a confusing user experience which is the reason you reported this in the first place so I will have a look to see if I can find a solution for that. This will take some time but for now you know how to solve your problem.
I'm not sure this qualifies as a bug because it makes sense you don't want to show pages from the wrong language (the database query makes use of the default Concrete5 page list query). But I do think this all leads to a confusing user experience which is the reason you reported this in the first place so I will have a look to see if I can find a solution for that. This will take some time but for now you know how to solve your problem.
Hi Justin
Thank you for getting back to me.I have been selecting the right site tree but it isn't working for me. There has to be a bug here. I am 100% sure I am selecting the right pages for the right locale.
Any ideas?
Also I don't get any errors just no data is saved.
Thanks
Jack
Thank you for getting back to me.I have been selecting the right site tree but it isn't working for me. There has to be a bug here. I am 100% sure I am selecting the right pages for the right locale.
Any ideas?
Also I don't get any errors just no data is saved.
Thanks
Jack
Strange, I will see if I can figure out what's going on. Using the PageList class is rather important because it builds the proper query with all kinds of default joins. Can you upload a screenshot of the PagePicker form so I can see what pages you added and a screenshot of the sitemap expanded? This might help me get a sense of what you are doing so I can reproduce the problem. I will get to it after I get home from work tomorrow. I'm actually kind of curious to figure out the problem.
Saving the pages is not the problem by the way, if you check the database table 'pkgPagePickerPlusPages' you will see they are saved. It's the select query that's not working properly. That's why it seems they aren't saved.
Saving the pages is not the problem by the way, if you check the database table 'pkgPagePickerPlusPages' you will see they are saved. It's the select query that's not working properly. That's why it seems they aren't saved.
Hi Jack,
I've been fiddling around for a while now and the only way I manage to reproduce the bug is when I select pages from the wrong site tree. However you said it is the right site tree.
I inspected the database query and noticed Concrete's PageList class filters on the current site tree, which is causing the pages from the other site tree not to show up. Other than that there's nothing unusual about the query.
This is an example query done by the PageList for the page picker:
It returns nothing until I leave out the p.siteTreeID part.
I think I found a solution. Could you open this file:
You will see this block of code:
Could you edit it so that it looks like this:
So that is the same code but with two lines extra. After doing that please check if the bug still occurs. I think it should work now. If so, please let me know and I will release a new version with this fix.
I've been fiddling around for a while now and the only way I manage to reproduce the bug is when I select pages from the wrong site tree. However you said it is the right site tree.
I inspected the database query and noticed Concrete's PageList class filters on the current site tree, which is causing the pages from the other site tree not to show up. Other than that there's nothing unusual about the query.
This is an example query done by the PageList for the page picker:
SELECT p.cID FROM Pages p LEFT JOIN btPagePickerPlusPages ppp ON ppp.cID = p.cID LEFT JOIN PagePaths pp ON (p.cID = pp.cID and pp.ppIsCanonical = true) LEFT JOIN PageSearchIndex psi ON p.cID = psi.cID LEFT JOIN PageTypes pt ON p.ptID = pt.ptID INNER JOIN Collections c ON p.cID = c.cID INNER JOIN CollectionVersions cv ON p.cID = cv.cID LEFT JOIN CollectionSearchIndexAttributes csi ON c.cID = csi.cID WHERE (ppp.bID = 282) AND (p.cPointerID < 1) AND (p.cIsTemplate = 0) AND (cvIsApproved = 1) AND ((cvPublishDate <= '2019-02-26 17:28:44' or cvPublishDate is null)) AND (p.cIsActive = TRUE) AND (p.siteTreeID = 2) AND (p.cIsSystemPage = FALSE) ORDER BY ppp.position ASC
It returns nothing until I leave out the p.siteTreeID part.
I think I found a solution. Could you open this file:
/packages/page_picker_plus/blocks/page_picker_plus/src/Page/PageList.php
You will see this block of code:
public function __construct(\Concrete\Core\Search\StickyRequest $req = null) { parent::__construct($req); // Setup our join; only returns pages that are save to the page picker pages table $this->query ->leftJoin('p', Controller::PAGES_TABLE, 'ppp', 'ppp.cID = p.cID') ->orderBy('ppp.position', 'ASC'); }
Could you edit it so that it looks like this:
public function __construct(\Concrete\Core\Search\StickyRequest $req = null) { parent::__construct($req); $this->setSiteTreeToAll(); $this->includeSystemPages = true; // Setup our join; only returns pages that are save to the page picker pages table $this->query ->leftJoin('p', Controller::PAGES_TABLE, 'ppp', 'ppp.cID = p.cID') ->orderBy('ppp.position', 'ASC'); }
So that is the same code but with two lines extra. After doing that please check if the bug still occurs. I think it should work now. If so, please let me know and I will release a new version with this fix.
Hi Justin
I have just come across this issue while adding a page picker block to a global stack. the above fix you have given works.
Thanks
Jack
I have just come across this issue while adding a page picker block to a global stack. the above fix you have given works.
Thanks
Jack
Unfortunately they made alterations to the core in Concrete version 8 wich
is causing bugs with all my add-ons. I'm am very unhappy with this. That is
why I added comments in bold on all the pages of my add-ons to warn users
that the add-ons are not compatible with version 8.
I have to refactor and test all my add-ons for version 8 so it will be a
while before I can get them released. So unfortunately I can't offer
support on the issue because the Concrete team basically broke my code and
it is not a bug in the add-on. You can get your money back if you contact
the Concrete team. There will be a new release eventually that addresses
this problem. Could you supply me with the steps to reproduce the problem?
Then I can fix it in the new release.
Regards,
Justin
On Jan 5, 2017 5:55 AM, "concrete5 Community" <discussions@concretecms.com>
wrote: