CVS edit link for drasgroup

I am ready to publish a module for D7 that allows for content "publish/unpublished" status to be updated based on a click thru that is generated via email as the content is created.

Drupal 6 or older requires a patch to node module to allow node_api to over-ride node-edit, based on a session variable generated when a link is clicked.

It is relatively trivial in code, but because of the lack of an "access" op in node-api imho hasnt been implemented., so this is new functionality??

thanks for your time

long time drupaler, first time caller

CommentFileSizeAuthor
#2 anon_content.zip8.16 KBdrasgroup

Comments

avpaderno’s picture

Hello, and thank you for applying for a CVS account.

Remember to attach the archive containing the proposed module, as reported in the email message Drupal.org sent you; differently, this application will not proceed.

drasgroup’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new8.16 KB

Thanks for your fast response with my initial request.

I have been working on converting the logic in this module over to 7.
It is very much still in need of development, but i am looking to see if other people might have comments on how to implement this.

a working drupal 6 version of this module exists, but uses a node_access patch to validate a session variable. i havent gotten

at this point all this does is:

add a validated email address field to node types,
record a checksum type value for each node,
send the link to the email address,
publish the node if the link is accessed.

i need to fill in much functionality. as this is my first submission; i am trying to avoid heading off in a terrible direction due to something i havent come across yet by publishing the framework for comment.

thanks for your time,

-james wilson

avpaderno’s picture

Status: Needs review » Needs work
  • The points reported in this review are not in order of importance / relevance.
  • Most of the times I report the code that present an issue. In such cases, the same error can be present in other parts of the code; the fact I don't report the same issue more than once doesn't mean the same issue is not present in different places.
  • Not all the reported points are application blockers; some of the points I report are simple suggestions to who applies for a CVS account. For a list of what is considered a blocker for the application approval, see CVS applications review, what to expect. Keep in mind the list is still under construction, and can be changed to adapt it to what has been found out during code review, or to make the list clearer to who applies for a CVS account.
  1. project = "anon_content"
    version = "7.x-1.x-dev"
    core = "7.x"
    datestamp = "1282868187"
    

    Those lines need to be removed as they are already added by the packaging script, and duplicating them just confuses the update manager.

  2. /**
     * Implementation of hook_install().
     */
    function anon_content_install() {
      drupal_install_schema('anon_content');
    }
    
    
    
    
    
    
    /**
     * Implementation of hook_uninstall().
     */
    function anon_content_uninstall() {
      drupal_uninstall_schema('anon_content');  
      
      //data type variables 
    
      variable_del('anon_content_node_types');
    }
    
    

    The calls to drupal_uninstall_schema(), and drupal_install_schema() are not anymore necessary in Drupal 7.

  3. See http://drupal.org/coding-standards to understand how a module should be written. In particular, see Drupal variables, global variables, constants, and functions defined from the module should be named; how the code should be formatted.
  4. Hook implementation comments should be like the following one:
    /**
     * Implements hook_menu().
     */
    

    As reported in Documenting hook implementations:

    If the implementation of a hook is rather standard and does not require more explanation than the hook reference provides, a shorthand documentation form may be used in place of the full function documentation block described above:

    /**
     * Implements hook_help().
     */
    function blog_help($section) {
      // ...
    }
    

    This generates a link to the hook reference, reminds the developer that this is a hook implementation, and avoids having to document parameters and return values that are the same for every implementation of the hook. Optionally, you can add more information in a separate paragraph to describe the particular quirks of your hook implementation.

    In the case of hooks that have variables in the names, such as hook_form_FORM_ID_alter(), a slightly expanded syntax should be used:

    /**
     * Implements hook_form_FORM_ID_alter() for node_type_form().
     */
    function mymodule_form_node_type_form_alter(&$form, &$form_state) {
      // ...
    }
    

    This generates a link to the hook reference, as well as to the particular form that is being altered. Again, optionally you can add more information in a separate paragraph to describe the particular quirks of your hook implementation.

  5. require_once("anon_email/anon_email.module");
    

    It usually not a good idea to unconditionally include code contained in PHP files. If the files contain form handlers, theme functions, or menu callbacks, Drupal core code allows to third-party modules to define which files must be loaded in the implementations of hook_menu(), and hook_theme(); in these cases, Drupal loads the file only when necessary.

  6. Menu descriptions and titles, as well as schema descriptions, should not be passed to t().
  7. function anon_content_hook_help($path, $arg)
    {
    	switch($path) {
    	case 'admin/help#anon_content':
    		$output = t('anon_content Validation Admin');
    	return $output;
    	}
    }
    
    

    The hook name is not correct. The code is not formatted as it should.

  8. Remove any debugging code.
  9. 							drupal_goto($nodepath['path']);
                                                             // OR RENDER NODE ONTO THIS FORM TO KEEP THE DEBUG AN THIGNS ON THE SAME PAGWE
                                                                        return;
    
    

    A form validation handler verifies if the form contains valid values; it doesn't call drupal_goto().
    The comment is not comprensible.
    The code is not formatted as it should.

  10. 						drupal_set_message("your post did not load successfully.");
    
    

    Strings used in the user interface should be translated.

  11. if (isset($_SESSION['anon_content_debug']) )
    	{	
    	return TRUE;
    	}
    return  FALSE;
    
    

    Is there an easier way to write that function?

  12.     if (anon_content_check_debug() )
        {
         echo "<hr><div style='background:grey;padding:20px'><div><pre> ";
    
                  if (is_array($title)|| is_object($title))
                    print_r($title);
             else
                 echo($title);
    
         echo "[][][][][]</div><div style='font-weigt:bold'>";
    

    The code is outputting HTML without to use a theme function.

  13.   function tearDown() {
        // TODO: Put your code here.
    
        // Always call the tearDown() function from the parent class.
        parent::tearDown();
      }
    
        /**
       * SimpleTest core method: code run before each and every test method.
       *
       * Optional. You only need this if you have setup tasks.
       */
      function setUp() {
        // TODO: Put your code here.
    
        // Always call the setUp() function from the parent class.
        parent::setUp();
      }
    

    If the method only calls the parent method, then it can be removed.

  14. The presence of some @todo comments, and an empty SimpleTest makes me think the code is not complete, which is not what one of the requirements asks for.
avpaderno’s picture

Component: Miscellaneous » new project application
Status: Needs work » Closed (won't fix)

I am closing this application due to lack of activity.

avpaderno’s picture

Issue summary: View changes

Please read the following links as this is very important information about CVS applications.