drupal
Working with version control on a Drupal/CMS project
You are correct that this is an issue for Drupal–version control works fine until you turn the site over to your client or open it up to users. Your question seems like a more specific version of this one, which touched on version control in the Drupal workflow. You may find some answers there that … Read more
Attaching image files to nodes programmatically in Drupal 7
Here is an example code using which you can use with node_save $filepath = drupal_realpath(‘misc/druplicon.png’); // Create managed File object and associate with Image field. $file = (object) array( ‘uid’ => 1, ‘uri’ => $filepath, ‘filemime’ => file_get_mimetype($filepath), ‘status’ => 1, ); // We save the file to the root of the files directory. $file … Read more
How can I tell whether a web app was built using Angular (or other technologies)?
The best way to check is to write “angular” on browser console. If you get any object [With child objects as “bind”,”bootstrap”,”callbacks”,”module” etc.] then its an angular web app.
How to get the full URL of a Drupal page?
drupal_get_destination() has some internal code that points at the correct place to getthe current internal path. To translate that path into an absolute URL, the url() function should do the trick. If the ‘absolute’ option is passed in it will generate the full URL, not just the internal path. It will also swap in any … Read more
How can I check Drupal log files?
To view entries in Drupal’s own internal log system (the watchdog database table), go to http://example.com/admin/reports/dblog. These can include Drupal-specific errors as well as general PHP or MySQL errors that have been thrown. Use the watchdog() function to add an entry to this log from your own custom module. When Drupal bootstraps it uses the … Read more
What is Drupal’s default password encryption method?
Drupal 8 and Drupal 7 use SHA512 by default with a salt. They run the hash through PHP’s hash function numerous times to increase the computation cost of generating a password’s final hash (a security technique called stretching). With Drupal 8, the implementation is object oriented. There is a PasswordInterface which defines a hash method. … Read more
Adding text (just text!) to a form in Drupal 7 [closed]
You can do this using #markup: $form[‘some_text’] = array( ‘#markup’ => ‘<p>Some text</p>’ );
What’s best Drupal deployment strategy? [closed]
A couple of tips: Use source control, NOT FTP/etc., for the files. It doesn’t matter what you use; we tend to spin up an Unfuddle.com subversion account for each client so they have a place to log bugs as well, but the critical first step is getting the full source tree of your site into … Read more
CSS to hide INPUT BUTTON value text
I use button {text-indent:-9999px;} * html button{font-size:0;display:block;line-height:0} /* ie6 */ *+html button{font-size:0;display:block;line-height:0} /* ie7 */