Recently Browsing 0 members
- No registered users viewing this page.
Error: Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'page_path_history.language_id' in 'field list' (in wire/modules/PagePathHistory.module line 752)By JeevanisM
I have installed 1 year old project backup into the new latest PW version. I used an earlier backup(taken in August 2020) and installed such as :
1. I downloaded the latest (ProcessWire 3.0.185 dev © 2021) then extracted into htdocs 2. copy pasted the site-profile from my backup. (this has the files/folders same as other site profiles, classic, beginner etc) 3. I chose my backup site profile and installed 4. I am able to login the admin panel 5. My fronted home page shows error as below Error: Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'page_path_history.language_id' in 'field list' (in wire/modules/PagePathHistory.module line 752) #0 wire/modules/PagePathHistory.module (752): PDOStatement->execute() #1 wire/core/PagesPathFinder.php (1014): PagePathHistory->getPathInfo('/', Array) #2 wire/core/PagesPathFinder.php (222): PagesPathFinder->getPathHistory('/') #3 wire/core/PagesRequest.php (255): PagesPathFinder->get('/', Array) #4 wire/core/Wire.php (414): PagesRequest->___getPage() #5 wire/core/WireHooks.php (951): Wire->_callMethod('___getPage', Array) #6 wire/core/Wire.php (485): WireHooks->runHooks(Object(PagesRequest), 'getPage', Array) #7 wire/modules/Process/ProcessPageView.module (10 This error message was shown because: you are logged in as a Superuser. Error has been logged.
so I removed the line where its selecting language_id from the file wire/modules/PagePathHistory.module line 752
But this is an ugly fix, so is there any other proper fix for this issue ? Does any one experience same issue when trying to install from a backup site profile ?
I was hoping to be able to do this entirely in PHP but was having all kind of issues getting it to see my values as numbers instead of strings (got error messages because my PW debugging is currently set to true). I currently have about 10 cards that PW is generating that include thumbnails, descriptions, donation amounts (raised amounts and goal amounts), and donate buttons. What I was trying to do was take the goal amount divide it by the raised amount (using PHP) and simply insert that value into the Progress element's Value attribute. Sounded simple enough but I couldn't get PHP to simply divide those two fields. First I tried dividing the goal value by the raised value and inserting it into the value attribute, like so:
<? php $raised = $page->get("raisedAmount$count"); $goal = $page->get("goalAmount$count"); $percent = $goalNum / $raisedNum; ?> <progress value="<?php echo $percent; ?>" max="100"></progress> Which gave me this error message:
Uncaught TypeError: Unsupported operand types: string / string
Then I tried converting the two strings to integers because apparently PHP couldn't detect they were numbers and do it, like so:
<?php $raised = $page->get("raisedAmount$count"); $goal = $page->get("goalAmount$count"); $goalNum = (int) $goal; $raisedNum = (int) $raised; if ($raisedNum != 0) : $percent = $goalNum / $raisedNum; else: $percent = 0; endif; ?> <progress value="<?php echo $percent; ?>" max="100"></progress> but all of the progress bars remain at zero percent (not shown), even when I have values in some of the $raised variables.
Please note, if I add this code:
<?php echo $percent; ?> below the Progress element, it shows 0 on every single card, so the $percent is never calculated (as per the $percent = $goalNum / $raisedNum;) even though $raisedNum should not equal 0 during that iteration of the loop (the original code includes a loop, which I omitted to keep the code sections above smaller, notice the $count at the end of the $raised and $goal variable declarations). When the loop goes over "raisedAmount1" there is a value in there; however, after typecasting it to an integer ($raisedNum) the value is 0 for someodd reason instead of 40,000, which is what is in the $raisedAmount1 field in Processwire...
I'm new to relatively new to PHP and Processwire and could really use some help on this one. Thanks in advance for any helpful replies!
Exception: Page is not currently viewable when using $page->children('include=all') and role cannot page-editBy SwimToWin
I have a nested page structure that fails for users without superuser permissions:
Works for superusers / non-superusers:
--- page (status: published)
---- page (status: published)
--- page (status: published)
Fails for non-superusers (Works for superusers):
--- page (status: published)
---- page (status: published)
--- page (status: unpublished <- apparently the template structure fails when there's one unpublished page)
<?php foreach ($page->children('include=all') as $p): #Fails for non-superusers ?> <?=$p->render()?> <?php endforeach; ?> a) Works for non-superusers when I grant Page Edit permissions (on the template) to their assigned role/s.
b) When I remove 'include=all' or 'include=unpublished' then it also works for non-superusers:
<?php foreach ($page->children() as $p): #Works for non-superusers ?> <?=$p->render()?> <?php endforeach; ?> Error message (non-superusers)
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Error has been logged.
/foo/bar/baz/ Error: Exception: Page '/foo/bar/baz/quz/' is not currently viewable.
/foo/bar/baz/ Page '/foo/bar/baz/quz/' is not currently viewable. (in /wire/modules/PageRender.module line 410)
Error: Exception: Page '/foo/bar/baz/quz/' is not currently viewable. (in wire/modules/PageRender.module line 410)
#0 wire/core/Wire.php (397): PageRender->___renderPage(Object(HookEvent))
#1 wire/core/WireHooks.php (823): Wire->_callMethod('___renderPage', Array)
#2 wire/core/Wire.php (465): WireHooks->runHooks(Object(PageRender), 'renderPage', Array)
#3 wire/core/WireHooks.php (924): Wire->__call('renderPage', Array)
#4 wire/core/Wire.php (465): WireHooks->runHooks(Object(Page), 'render', Array)
#5 site/templates/template.php (191): Wire->__call('render', Array)
"Permission “page-sort” for template “ ... ” not allowed (requires “page-edit” permission)"
– This lovely error message is thrown at me, if, as implied by it, I try to add (to my "editor" role) the permission "page-sort" for a specific template, without the permission "page-edit" enabled for the same template.
Seems like it's been mentioned a few times before but never properly answered, by e.g. @Robin S ... :
"Allow the granting of page-sort permission independent of page-edit": https://github.com/processwire/processwire-requests/issues/29
Why do I wanna do this?:
I have a page tree structure 🌳 as so:
– Page a [C1_p] – Page b [C1_p] Different category [C2]
– Page c [C2_p] – Page d [C2_p] ________________________
The page "Category" has the page-template "C1",
the pages "Page a" and "Page b" both have the page-template "C1_p".
The page "Different category" has the page-template "C2"
the pages "Page c" and "Page d" both have the page-template "C2_p".
The two pages called "Category" and "Different category" do not have any content, they only serve as containers for pages belonging to that category.
I want my "editor" role not to be able to do anything at all with these pages "Category" and "Different category"; i.e. I do not want my editor to be able to edit, move, unpublish, hide, lock, delete (or do anything else to) these category pages.
– So, I want my "editor" role to have the "page-edit" permission for pages with the templates "C1_p" and "C2_p", but not for the pages with the category templates "C1" and "C2",
Also, I want my "editor" role to be able to move the pages with the templates "C1_p" and "C2_p" within their parent-pages.
But if I just simply add the "page-edit" and the "page-move" permissions for the "C1_p" and "C2_p" templates, then, using the "editor" role, I am not able to move these "C1_p" (and "C2_p") -template-based pages. I can actually click "MOVE" next to them and then move them, but... then I will be met by the error message "You do not have permission to sort pages using this parent - /Category/".
– So, I try to add the "page-sort" (description: "permission to sort child pages") permission to the "C1" and "C2" templates... but then trying to do so I am met by the initially mentioned error message ! Permission “page-sort” for template “C1” not allowed (requires “page-edit” permission) .
And, as mentioned, I do not want my editor role users to be able to edit these category ("C1" and "C2") pages...
– what to do about this? 😅
All the best,
Hey all. I'm having an issue with the new custom page classes feature which is a fantastic tool.
I am running into a recursion issue when attempting to call a custom page class. I have a class called BlogPostPage.php (for blog-post.php) which contains a method called getSummary(). That method gets a summary field or truncates the body in it's absence. I've attached photos of the template code, custom page class code (which I've simplified for testing), and the PW output error.
There is no recursion in the getSummary() method. This error occurs whether I output multiple blog posts in a loop or if I output one blog post with no looping in my template code.
ProcessWire 3.0.164 dev
I am also using the Template Engine Twig module which has not caused any errors or issues thus far.