php
Error on autocomplete node reference field: found no valid post with that title.
Wed, 04/14/2010 - 15:58 | gurayc
When importing content into a node reference field that is shared the preview import throws the following error:
Fieldname: found no valid post with that title.
I have found the cause of this problem and can offer a partial solution.
The cause is that the validation function nodereference_autocomplete_validate in nodereference.module expects data in a different format than what is supplied by nodereference.inc of node_import. This function expects data in one of three forms:
"node title"
"node title [nid:node id]"
"[nid:node id]"
I was able to make it work for importing noderefs by node id. I have not tested it with importing noderefs by title, although that might work also. In the file node_import/supported/cck/nodereference.inc, the line
5
Average: 5 (1 vote)
Drupal : Wrong Imagecache File Path if User Changes "File System Path"
Mon, 04/12/2010 - 16:41 | gurayc
When calling the image, it generates the address: /sites/default/all/imagecache/preset/IMAGE When it should generate: /sites/default/all/imagecache/preset/sites/default/all/IMAGE
The file's path is being saved properly to the database, imagecache is just having a hard time adding the file system's path before the file name.
To fix the original reported issue:
If you have direct SQL access, e.g., through a shell or PHPMyAdmin:
Run the following query: UPDATE files SET filepath = REPLACE(filepath, 'sites/default/files/', 'sites/example.com/files/')
where example.com is the name of the directory your site is located in.
0
Drupal : Evaluate PHP in pattern + Token
Thu, 04/08/2010 - 13:50 | gurayc
How to use tokens with PHP in Drupal? Here is the answer.
5
Average: 5 (1 vote)
PHP random number generator
Fri, 03/26/2010 - 12:21 | gurayc
Generate random number with this function.
5
Average: 5 (1 vote)
PHP random color generator
Fri, 03/26/2010 - 12:17 | gurayc
Generate random color with this function.
5
Average: 5 (1 vote)
PHP explode example
Fri, 03/26/2010 - 12:15 | gurayc
Parse text with php explode function.
5
Average: 5 (1 vote)
RSS/XML Date Output format
Fri, 03/26/2010 - 12:13 | gurayc
Put date to your rss or xml output.
5
Average: 5 (1 vote)
Drupal Auto Node Title cant get [nid]
Fri, 03/26/2010 - 01:44 | gurayc
Use this code in your autonode title description area.
2
Average: 2 (1 vote)
Generate short urls with bit.ly using PHP
Thu, 03/04/2010 - 23:43 | bbayer
Bit.ly url shortener service is very successful project and has good api for automatic url shortening. Note that bit.ly uses authentication on API calls and you need to register before continue. original author: http://davidwalsh.name/bitly-php
0
Google Trends PHP API
Thu, 03/04/2010 - 21:08 | bbayer
Simple PHP library that fetches latest trends keywords from Google Trends.
$trends = new GoogleTrendsAPI();
$keywords = $trends->get_trends();
0
Recent comments
-
That is cool!12 weeks 4 days ago
-
sexcam13 weeks 6 days ago
-
thanx26 weeks 4 days ago
-
It is very usefull man thanks26 weeks 4 days ago
-
not at all26 weeks 5 days ago
more

