Joshua Williams's blog

Extending Drupal 7 text field character limit

After getting the message, "There is data for this field in the database. The field settings can no longer be changed." while trying to extend the character limit for a text field in a Drupal 7 instance, I used the code below to increase the character limit. It modifies the relevant parts of the database to allow more characters. I ran the SQL code through a content node with the PHP Code Text Filter enabled, but it could also be run in a custom module.

Call to undefined function money_format

While setting up a local copy of a Magento based e-commerce site on my Windows machine, I was presented with a number of messages stating, "Fatal error: Call to undefined function money_format()." After a little research I was able to discover that this particular PHP function is not available on the Windows platform.

In order to get access to a version of the function that would be available from anywhere in the site's php code, I used the Apache auto_prepend_file directive in my php.ini file:

Views Block with Arguments

Blocks created by a view in Drupal do not have access to the page URL and thus arguments won't work normally. However, by using some custom PHP code in the argument default setting, we can pass information from the URL to the block as if it were a page.

The best tutorial I was able to find on this is here: Drupal View Block With Arguments

The PHP code I used to get a user's blog to show under his team profile page on this site is below. Used as default argument code for "User: Name."

Syndicate content