Jump to content

Switching fields to Language fields produces fatal errors


arjen
 Share

Recommended Posts

Switching fields like PageTitle to PageTitleLanguage gives errors like:

Error: Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_title.data1011' in 'field list' (in /Users/xxx/Sites/xxx/www/wire/core/DatabaseQuery.php line 86)

Both admin and frond-end gives this error.

Installed (core) modules:

Languages Support (1.0.1)
Languages Support - Fields (1.0.0)
Languages Support - Page Names (0.0.8)
Languages Support - Tabs (1.0.8)

ProcessWire: 2.3.9 (clean install with the latest dev branch - 0bb84e0d9fdd973376e5bbaaa1e1e4cf4fcc8c5c)

PHP version: 5.4.17

MySQL version: 5.6.14

When I try the same files on another MySQL version 5.1.54 the changing works fine.

Does anyone knows if this is MySQL related and how to fix this? Thanks!

Link to comment
Share on other sites

I did some more research. With PHP 5.5.3 and MySQL 5.5.33 (MAMP) the switching between PageTitle and PageTitleLanguage works fine with a clean install. But when importing the files from the other version it won't work resulting in the same errors.

Link to comment
Share on other sites

More research. Now on Windows with XAMPP (1.8.3) and PHP 5.5.6 and MySQL 5.6.14. Since the MySQL versions are the same on my local development machine I think I can rule out that it's a bug regarding that specific MySQL version. Will investigate further in the next days.

  • Like 1
Link to comment
Share on other sites

Thanks for investigating this. If you find that it is something repeatable please send over a GitHub bug report (or post here if you prefer). I did just try to reproduce it myself (in MAMP), but wasn't able to yet. 

Link to comment
Share on other sites

With the latest dev (8c42730c4f79c894bbf380870e3c06216bf860df) branch no errors on:

PHP version: 5.4.17

MySQL version: 5.1.73

 

When I install MySQL 5.6.14 I'm getting the errors again on the same install. I'm using the 5.1.x version of MySQL for now. If no-one is getting errors I'm giving up :)

Link to comment
Share on other sites

I thought of that too, but I ran disc utility and the problem still persits. If I install the latest MySQL it's broken. It I remove it and install the older MySQL version it's working. When I delete that one and install the latest version it's broken, and so on.

Link to comment
Share on other sites

I will upgrade to the latest MAMP here soon and see if I can reproduce it. You've got me wondering if there is some incompatibility with that version of MySQL (5.6.14). Though if it were widespread, you'd think we would have heard about it more than once.. and maybe we will. I'll keep an eye out and do some testing here too. 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

redirect from topic:
http://processwire.com/talk/topic/5788-bug-fieldtypepagetitlelanguage/

I have tried to change the title fieldtype from Title to TitleLanguage in PW 2.4

got Error: Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_title.data1019' in 'field list' (in /wire/core/DatabaseQuery.php line 86)

Hi, I am using PHP 5.4.24, 5.6.10 MySQL and Master PW 2.4. The Error happens if I want to switch any existing field to the Multilanguage Version AFTER I had installed the new language. It works if I do it the other way round. In the case of the title field, which is not deletable I added the specific language column like 'data1019' manually to the database table.

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 months later...

Just wanted to add that I have the same problem on PW 2.4 release and 2.4.5 - it happens every time I change a field type to it's Language version. The only fix seems to be to manually create the dataxxxx field in the DB.

Link to comment
Share on other sites

  • 1 month later...

I've run into the same issue.

I found the following query to be the culprit:

SELECT false AS isLoaded, pages.templates_id AS templates_id, pages.*, pages_sortfields.sortfield, (SELECT COUNT(*) FROM pages AS children WHERE children.parent_id=pages.id) AS numChildren,field_title.data AS `title__data`,field_title.data1013 AS `title__data1013` 
FROM `pages` 
LEFT JOIN pages_sortfields ON pages_sortfields.pages_id=pages.id 
LEFT JOIN field_title ON field_title.pages_id=pages.id 
WHERE pages.templates_id=44 
AND pages.id IN(1009,1013) 
GROUP BY pages.id

Also note that the page id 1013 is the language page.

Edit: This is running on

ProcessWire 2.4

PHP 5.4.30

MySQL 5.6.19

Link to comment
Share on other sites

  • 2 months later...

Same problem here, but I get the following error after adding an additional language:

Error:  Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'pages.name1017' in 'where clause' (in /var/www/vhosts/xxx/xxx/wire/core/DatabaseQuery.php line 91)

My server is running PHP 5.3.10 / MySQL 5.5.38. I installed PW 2.5.3 using the 'Multi Language' profile.

Additionally - I'm not sure if it's related to this issue - I can only see or edit the page name for the default language (as reported here with screenshots).

Link to comment
Share on other sites

@Didjee - Looks like Ryan may have taken care of most of this, but not quite all. It is an SQL settings issue - certain settings come by default in MySQL 5.6.x, but can also be present on other versions. Does adding that field (column) to the pages DB table take care of it? I'll let Ryan know, but it would be good if you could confirm that fixes things fully.

Link to comment
Share on other sites

I've tried to duplicate this one here, but haven't been able to. I've kept the MySQL settings for my dev server at the strictest settings possible for the last month or so, so am thinking that whatever the issue is here, it's probably something different than we've seen elsewhere. Also, so far this is the only report I'm aware of this occurring in the current release version of PW. Since the error is very similar to the one we saw before the MySQL settings issue was fixed, I do wonder if just grabbing a fresh copy of the PW core might be a good idea here. Didjee if you are able to try that, please let me know. You might want to try the dev branch, since that always has the latest updates on it. 

Link to comment
Share on other sites

@Ryan: I did a fresh install using the dev branche of PW. I tested this locally using MAMP with PHP 5.3.29 / MySQL 5.5.38.

I tested the following scenarios:

  1. Installed PW using the multi language profile without changing the admin name. Added a new language: no errors
  2. Installed PW using the multi language profile, changed the admin name from processwire to admin. Added a new language: no errors.
  3. Installed PW using the multi language profile, changed the admin name from processwire to sitemanager. Added a new language: getting the errors as posted earlier.

Conclusion: I think this errors have something to do with the fact that the admin name is starting with site (as you already suggested here https://github.com/ryancramerdesign/ProcessWire/issues/764). It also has an effect on LanguageSupportPageNames.

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
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Aswincs
      Here are the step by step to install and setup ProcessWire with the help of a server management tool - https://cloudstick.io/
      1. Create your Vultr compute.

      2. Select the Operating system Ubuntu 16.04/18.04/20.04 LTS >> Enter your server root password then click on Deploy now!

      3. Create an account in CloudStick and connect your server:
       
      Click on connect server >> Enter your server login details >> Add this server.

      4. Your server setup will be done in couple of minutes - The setup will finish less than 8 minutes. Then select your server:

      5. Create an account to host/upload ProcessWire: Click on Accounts >> Create an account >> Create Custom Web application:

      6. Enter the web application details, such as the email address which you would like to receive the SFTP login details >> web application name >> Domain name >> username then >> select the web application stack >> nginx + apache >> then create web application. 

      7. Now select the web application then install SSL: 
      8. Open your email account, and find the login details to connect the server over SFTP >> then upload the source code of ProcessWire:

      9. Let us open the domain in browser once the upload finish.

      10. Select the profile and click next:

      11. Click next to proceed further: Now, you will see an incompatibility issue with PDO-Mysql which can be install in 2 clicks.

       
      12. Go back to the summary page >> Click on easy PHP >> Select the PHP version of your web account:

      13. Then it is time to enable PDO_Mysql, scroll down and enable it:

      14. Go back to to the ProcessWire installation URL and click on check again >> You can see no incompatibility issue after enabling PDO_Mysql:

      15. Click on Next and now it is time to enter the database credentials:

      16. let us create the database, db user and grant privilege's to the db user - it is just matter of few clicks and very easy! 
      Click on the menu Accounts >> Select your web account of ProcessWire >> Click on App Database then create the a database:

      17: Click on create database and enter the database name:

      18. Create the database user:

      19: Go back to the database page and click on Grant user then grant permission:

      20. Go back to the ProcessWire installation URL and enter the database credentials you have created in CloudStick dashboard.
      Now, it is time to setup your admin user credentials and setup admin area URL:

      21. Then you are done:


    • By spercy16
      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!
    • By SwimToWin
      I have a nested page structure that fails for users without superuser permissions:
      Works for superusers / non-superusers:
          - foo
          -- bar
          --- page (status: published)
          ---- page (status: published)
          --- page (status: published)
      Fails for non-superusers (Works for superusers):
          - foo
          -- bar
          --- page (status: published)
          ---- page (status: published)
          --- page (status: unpublished <- apparently the template structure fails when there's one unpublished page)
      Template:
      <?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.
          /www/site/assets/logs/errors.txt
              /foo/bar/baz/    Error:     Exception: Page '/foo/bar/baz/quz/' is not currently viewable.
          /www/site/assets/logs/exceptions.txt
              /foo/bar/baz/    Page '/foo/bar/baz/quz/' is not currently viewable. (in /wire/modules/PageRender.module line 410)
      Debug (non-superusers)
          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)
       
    • By FireWire
      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.

      In use:
      ProcessWire 3.0.164 dev
      PHP 7.3.13

      I am also using the Template Engine Twig module which has not caused any errors or issues thus far.
      Many thanks!



    • By neonwired
      I'm hoping someone has seen this before. There doesn't appear to be an issue with the user info.

       

×
×
  • Create New...