Jump to content

Field may not be named 'published' because it is a reserved word


formmailer
 Share

Recommended Posts

Hi,

 

I just upgraded one of my sites to PW 2.8, in order to upgrade to the 3.x branch. But after upgrading to 2.8 the site isn't working anymore because i had a field named "published" (it's a site about books, so published seemed a good name once)...

The error message:

Quote

Error:
Exception: Field may not be named 'published' because it is a reserved word (in /home/zweedslezen_nl/public/wire/core/Field.php line 528)

Is there an easy way to resolve this, or would it be better to revert to 2.5 and change the fieldname before upgrading?

 

Thanks in advance!

/Jasper

Link to comment
Share on other sites

Hi @formmailer,

I'm not sure if there are better methods, but I have successfully changed a fieldname directly in the MySQL DB.

The steps I have done are:

  • open a mysql editor go into rows of table fields
  • find the field in question and change the name in column name
  • last step is renaming the table field_youroldname to field_yournewname

That was it. Now I'm able to access it in my templates via $page->yournewname.

If you are not able to open that DB live, you may also dump a mysql backup, change the names in it and restore it back, to take effect. (with module ProcessDatabaseBackup, for example)

  • Like 5
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

×
×
  • Create New...