miércoles, 20 de marzo de 2013

Drupal 7 - Algunos codigos

drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });', 'inline');

jueves, 14 de marzo de 2013

Drupal 7 - LINKS

http://api.drupal.org/api/views

http://api.drupal.org/api/views/includes!view.inc/class/view/7

http://api.drupal.org/api/views/views.api.php/group/views_hooks/7

http://api.drupal.org/api/drupal/includes!database!database.inc/function/db_select/7

Drupal 7 - Solucion error

PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in lock_may_be_available() (line 167 of /var/www/vocacion/includes/lock.inc).

/etc/init.d/mysql restart

miércoles, 20 de febrero de 2013

Drupal Community - Contribuir corrigiendo bugs, hacer cambios a un proyecto


1. Choose issue

http://drupal.org/project/issues/<project>

Buscar 'active' or 'needs work'.

2. Download project

Choose the latest branch, which will probably be 7.x-?.x or master.
Click 'Show' and copy the command.
Then run the command in the sites/all/<modules o theme> directory.

3. Find bug (egrep encuentra la cadena en el directorio)

egrep -r hook_node_info simpletest_example/

4. Make branch

git checkout -b [short description]-[issue-number]

5. Fix code

Refer to coding standards for code style.

6. Create patch

git diff > [description]-[issue-number]-[comment-number].patch

Randy Fay has a great post about patching with Git.

7. Upload patch for review

People often use Dreditor to review patches.

8. Make revisions

Once you get feedback, you can make revisions to the patch.
Refresh your repo using

git checkout [version]
git pull

Then re-apply changes:

git apply -v [patchname].patch

martes, 12 de febrero de 2013

Drupal Community - Contribute with New Project (Module, Theme)

http://drupal.org/contribute/development

0. Obtener acceso git

http://drupal.org/node/1047190

1. Crear Sandbox Project

http://drupal.org/node/1011196

3. Promover a Full Project

http://drupal.org/node/1015224

http://drupal.org/node/1011698

4. Verificar errores comunes

a. Ver errores con repositorio git - p.e. http://git.drupal.org/sandbox/relguzman/1917458.git
http://ventral.org/pareview

b. Cambiar de branch master

http://drupal.org/node/1127732

c. Readme file mas documentacion ademas de 'features', 'about'. 

Eliminar readme.md
Eliminar LICENSE.txt
Eliminar "version", "project" de ./__.info

5. Aplicar formatter - http://cssbeautify.com/

6. Hacer reviews a otros proys

Drupal 7 - Cambiar de Servidor Local a Remoto

Lo mismo que

Cambiar de servidor y cambiar de nombre de BD

Considerando
Mysql Database, Mysql User, MySQL Host

'host' => 'MySQL Host'

Drupal 7 - Instalacion de Modulos Recomendados

Jquery - version recomendada
jQuery v1.8.3

--------------------------------------------------

1. Clean URLS
2. Shortcut Clear cache
3. Instalar Modulos de inicio

http://drupal.org/project/module_filter - Filtros en los modulos
http://drupal.org/project/admin_menu

Desactivar modulo Toolbar

http://drupal.org/project/ctools - chaos tools
http://drupal.org/project/token
http://drupal.org/project/pathauto

http://drupal.org/project/wysiwyg - Wysiwyg
http://drupal.org/project/media - Media

http://drupal.org/project/media_youtube - Media: youtube o sino vimeo

http://drupal.org/project/views

4. Instalar tema
5. Crear tipos de contenido
- Project
- Publication
- Board

6. Configuracion Editor

CKEditor

Version compatible actual = CKEditor 3.6.6 (3 Jan 2013)

Copiar la carpeta dentro en /sites/all/libraries

/sites/all/libraries/ckeditor

6.1. Activar "Convert Media tags to markup filter"
The Convert Media tags to markup filter must be enabled for the Filtered HTML format in order to use the Media browser WYSIWYG button.

6.2. En "Wysiwyg profiles" - seleccionar "ckeditor" - editar el tipo de editor
6.3. En buttons and plugins
Agregar los botones BASICOS:

- Bold
- Italic
- Bullet List
- Numbered List
- Link
- Unlink
- Source Code
- Maximize
- Media Browser

7. Customizing Post Paths

Click on Configuration in the admin menu and in the Search and Metadata section
select the URL Aliases link.

Settings -> configuracion de nombres cortos
Patterns -> configuracion de urls
Cambiar "content/[node:title]" por “[node:created:custom:Y]/[node:created:custom:m]/[node:created:custom:d]/[node:title]"

8. Crear views(en vez de Basic Pages - para menu) - pag 35

- Home (default)
- Projects
- Blogs
- Publications

9. Instalar modulos

http://drupal.org/project/webform
http://drupal.org/project/mollom
http://drupal.org/project/sharethis


10. Configurar Bloques
11. Crear Contact - Webform

- Contact

11.1. Configurar
- Your name
- Your Email
- Subject
- Message

11.2. Configurar email de recepcion y otros - Email
11.3. Form Settings - Pag 43, 45

12. Mollon - prevenir spam

http://mollom.com

Configurar "Mollom settings page" - 46

### Pag 48-51 - no

13. Configurar - Share this

14. Instalar
http://drupal.org/project/styles

15. Configurar youtube media
- configuration - file System o file Types

16. Backup and migrate - 71

jueves, 24 de enero de 2013

Drupal 7 - Solucion - /admin/content not found

Solucionado despues de - Clean URLS

Drupal 7 - Solucion - Clean URL Test Failed

Main Apache configuration file:

In windows : httpd.conf

In Ubuntu : apache2.conf

Apache path : /etc/apache2

 - contains httpd.conf, apache2.conf

Apache service path : /etc/init.d/apache2root path : /var/www

1. Create a file phpinfo.php with:

<?php phpinfo();?>

http://localhost/phpinfo.php

'Loaded Modules', should contain 'mod_rewrite'.

If no, enable it in your apache configurationv : $ sudo a2enmod rewrite

2. Add these lines: /etc/apache2/httpd.conf

<Directory "/var/www/Drupal_Directory">
AllowOverride All
</Directory>

lunes, 14 de enero de 2013

Drupal 7 - Cambiar de servidor y cambiar de nombre de BD

1. Copiar todos los archivos

2. Crear la nueva BD e importar el BD.sql.zip

3. Cambiar /sites/default/settings.php con los datos nuevos

$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'musohead',
      'username' => 'root',
      'password' => '',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
);

Drupal 7 - Instalar en ubuntu

1. Iniciar bd para drupal

mysql -u root -p

CREATE DATABASE bd_drupal;

exit

2. Reiniciar servidor

apache sudo service apache2 restart

3. Permisos al archivo settings.php

~/web/drupal-7.16/sites$ chmod -R 777 default/

~/web/drupal-7.16/sites/default$ cp default.settings.php settings.php
~/web/drupal-7.16/sites/default$ chmod -R 777 settings.php


4. Instalar drupal

Drupal 7 - Login de usuario

Caso: Mantenimiento y luego cierre de sesion

Entrar a

http://WEB/?q=user/login

o

http://WEB/user/login

Drupal 7 - Traducir toda la interfaz a español

Install, Enable Module "Localization update"

http://drupal.org/project/l10n_update

Drupal 7 - Cambiar tema de drupal desde mysql

UPDATE system SET status=1 WHERE name = 'garland';

UPDATE variable SET value='s:7:"garland"' WHERE name = 'theme_default';

TRUNCATE cache;

UPDATE users SET theme='garland' WHERE uid = '1';

Otros casos:

Descomentar en settings.php

# $conf['theme_default'] = 'garland';

Drupal 7 - Change password

For this problem

Sorry, there have been more than 5 failed login attempts for this account. It is temporarily blocked. Try again later or request a new password."

on
/path_to_drupal_files

Generate encoded password
php ./scripts/password-hash.sh new_password

UPDATE users SET pass='YOUR_PASSWORD_HASH' where uid=1;

Remove flood content
truncate flood;

Drupal Community - GSOC Organization