Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2021-10-24 11:53:28

damaris1987
New Member
Registered: 2021-10-24
Posts: 3

Fatal Error after update and php Version 8.0

Hi!

After update to the latest version, the frontend of my website is working normally, but when i try to login to the admin area, it displays a fatal error, as shown below. I already looked into the file glz_custom_fields.php, but am lost… Can anyone help or did anyone experience the same issue?

Textpattern version is 4.8.7 and php version is 8.0

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /homepages/38/d13551078/htdocs/public_html/textpattern/plugins/glz_custom_fields/glz_custom_fields.php:680 Stack trace: #0 /homepages/38/d13551078/htdocs/public_html/textpattern/plugins/glz_custom_fields/glz_custom_fields.php(196): glz_format_ranges(Array, ‘Link’) #1 /homepages/38/d13551078/htdocs/public_html/textpattern/plugins/glz_custom_fields/glz_custom_fields.php(74): glz_values_custom_field(‘custom_1_set’, Array) #2 /homepages/38/d13551078/htdocs/public_html/textpattern/plugins/glz_custom_fields/glz_custom_fields.php(1053): glz_custom_fields_MySQL(‘values’, ‘custom_1_set’, ‘’, Array) #3 /homepages/38/d13551078/htdocs/public_html/textpattern/lib/txplib_misc.php(1589): glz_custom_fields_replace(‘article_ui’, ‘custom_fields’, ‘\n<div class=“tx…’, Array) #4 /homepages/38/d13551078/htdocs/public_html/textpattern/lib/txplib_admin.php(788): callback_event(‘article_ui’, ‘custom_fields’, 0, ‘\n<div class=“tx…’, Array) #5 /homepages/38/d13551078/htdocs/public_html/textpattern/include/txp_article.php(1603): pluggable_ui(‘article_ui’, ‘custom_fields’, ‘\n<div class=“tx…’, Array) #6 /homepages/38/d13551078/htdocs/public_html/textpattern/lib/txplib_admin.php(386): article_partial_custom_fields(Array, ‘custom_fields’) #7 /homepages/38/d13551078/htdocs/public_html/textpattern/include/txp_article.php(756): updatePartials(Array, Array, Array) #8 /homepages/38/d13551078/htdocs/public_html/textpattern/include/txp_article.php(123): article_edit() #9 /homepages/38/d13551078/htdocs/public_html/textpattern/index.php(228): include(‘/homepages/38/d…’) #10 {main} thrown in /homepages/38/d13551078/htdocs/public_html/textpattern/plugins/glz_custom_fields/glz_custom_fields.php on line 680

Edit by gaekwad: formatting.

Last edited by gaekwad (2021-10-25 06:26:20)

Offline

#2 2021-10-24 14:42:59

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,713
Website

Re: Fatal Error after update and php Version 8.0

Can you look at which version of glz_custom_fields you are using? Judging by the function names mentioned, I think you may be using gerhard’s original version of the plugin, which was last updated in 2013. Gerhard moved on long ago but the plugin is still useful and I updated it a while back. You can find it on GitHub. I’ve been using that with php 7 and 8. You can find instructions for updating there and the most recent version is available under “releases” in the right-hand sidebar.

Before updating, please take a backup of your database for safekeeping. If you run into difficulties let me know or mail me via the forum contact.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2021-10-25 10:02:27

damaris1987
New Member
Registered: 2021-10-24
Posts: 3

Re: Fatal Error after update and php Version 8.0

Hi, thank you for your response!
It is version
glz_custom_fields v1.4.0-beta1

There is only the folder glz_custom_fields, which contains only one file: glz_custom_fields.php

I will try, what you suggest! Should I delete the old file glz_custom_fields.php ? The distribution on github does not contain such a file.

Last edited by damaris1987 (2021-10-25 10:07:20)

Offline

#4 2021-10-25 10:16:57

damaris1987
New Member
Registered: 2021-10-24
Posts: 3

Re: Fatal Error after update and php Version 8.0

Ok, I copied the files into the glz_custom_fields folder and deleted the old file glz_custom_fields.php, but the error is still displayed, when i try to login:

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /homepages/38/d13551078/htdocs/public_html/textpattern/plugins/glz_custom_fields/glz_custom_fields.php:680 Stack trace: #0 /homepages/38/d13551078/htdocs/public_html/textpattern/plugins/glz_custom_fields/glz_custom_fields.php(196): glz_format_ranges(Array, ‘Link’) #1 /homepages/38/d13551078/htdocs/public_html/textpattern/plugins/glz_custom_fields/glz_custom_fields.php(74): glz_values_custom_field(‘custom_1_set’, Array) #2 /homepages/38/d13551078/htdocs/public_html/textpattern/plugins/glz_custom_fields/glz_custom_fields.php(1053): glz_custom_fields_MySQL(‘values’, ‘custom_1_set’, ‘’, Array) #3 /homepages/38/d13551078/htdocs/public_html/textpattern/lib/txplib_misc.php(1589): glz_custom_fields_replace(‘article_ui’, ‘custom_fields’, ‘\n<div class=“tx…’, Array) #4 /homepages/38/d13551078/htdocs/public_html/textpattern/lib/txplib_admin.php(788): callback_event(‘article_ui’, ‘custom_fields’, 0, ‘\n<div class=“tx…’, Array) #5 /homepages/38/d13551078/htdocs/public_html/textpattern/include/txp_article.php(1603): pluggable_ui(‘article_ui’, ‘custom_fields’, ‘\n<div class=“tx…’, Array) #6 /homepages/38/d13551078/htdocs/public_html/textpattern/lib/txplib_admin.php(386): article_partial_custom_fields(Array, ‘custom_fields’) #7 /homepages/38/d13551078/htdocs/public_html/textpattern/include/txp_article.php(756): updatePartials(Array, Array, Array) #8 /homepages/38/d13551078/htdocs/public_html/textpattern/include/txp_article.php(123): article_edit() #9 /homepages/38/d13551078/htdocs/public_html/textpattern/index.php(228): include(‘/homepages/38/d…’) #10 {main} thrown in /homepages/38/d13551078/htdocs/public_html/textpattern/plugins/glz_custom_fields/glz_custom_fields.php on line 680

Maybe the problem is in some other file?

Last edited by damaris1987 (2021-10-25 10:31:59)

Offline

#5 2021-10-25 12:05:11

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,713
Website

Re: Fatal Error after update and php Version 8.0

Looking at the instructions, I can see that there may be some confusion with the /plugin folder. Since Textpattern 4.8.x, Textpattern extracts the parts of installed plugins and puts them into the folder /textpattern/plugins/. With Textpattern 4.7 that wasn’t the case, so the instructions on GitHub could be confusing because Textpattern now has its own plugins folder (which you don’t want to overwrite). Try this:

  1. Backup you database :-)
  2. Go to the glz_custom_fields Releases page on GitHub. Download the .zip.txt plugin installer and the plugins.glz_custom_fields.zip file.
  3. Unzip the .zip file and place it in the root folder of your installation – i.e. at the same level (next to) the /textpattern folder.
  4. Open the .zip.txt file in a text editor and copy its contents.
  5. Visit Admin › Plugins and paste in the installer into the plugin installer textarea.
  6. Install and activate the plugin.

You should now have a new menu item Extensions › Custom Fields in which your custom fields are visible, and a new Admin › Preferences › Custom Fields where you can set the paths and URLs for the folder you added to your installation in Step 3 above.

If you already had any special solutions for your custom fields in the past – e.g. an own drop-down file – make sure you keep copies of those, as you will need to reinstate those afterwards in that folder.

Again, you’re welcome to contact me if you need specific help (I speak German too :-)


TXP Builders – finely-crafted code, design and txp

Offline

#6 2021-10-25 12:08:39

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,240
GitHub

Re: Fatal Error after update and php Version 8.0

Could you post your short diagnostics here, please?

In the admin-side, go to Admin → Diagnostics → check the box “Hide private information” → copy the contents of the big block of text → post here as a reply.

Edit – jakob beat me; I had a feeling the plugin was out of sync.

Last edited by gaekwad (2021-10-25 12:11:18)

Offline

#7 2021-10-25 19:15:35

etc
Developer
Registered: 2010-11-11
Posts: 5,149
Website GitHub

Re: Fatal Error after update and php Version 8.0

Hi,

to access the (broken) admin side, try textpattern/index.php?event=plugin.

Offline

Board footer

Powered by FluxBB