Skip to content

Deprecate Drupal legacy database structures/naming #956

Open
@jywarren

Description

@jywarren

This used to be a Drupal site (back in https://github.com/jywarren/plots days!)

This is a complex, multi-part issue which should be broken up into smaller issues, but just to provide an overview:

The legacy Drupal stuff is almost eliminated, but is confusing for new contributors -- mostly at this point it's:

The word Drupal on some models

We could rename DrupalNode to Node, for example, and this line in the model would then be unnecessary:

https://github.com/publiclab/plots2/blob/master/app/models/drupal_node.rb#L20-L21

But this would need to be a find/replace throughout the codebase!

The filename here: /app/models/drupal_node.rb could then become /app/models/node.rb

So, in summary, we've completed:

Remaining to refactor

There are a few others, but we should look into how heavily they're even used, as we could start a new project to begin simplifying/deprecating older models:

  • Code related to Answer model (not Drupal but we do want to deprecate it): https://github.com/publiclab/plots2/search?q=answer
  • drupal_content_field_image_gallery.rb - these could be merged into (added before) the body content field of the nodes they're attached to and this "gallery" feature finally dumped (broken out into Refactor legacy gallery code into node revision body #4074)
  • drupal_content_field_map_editor.rb - this and 2 below could be merged into the map node body field and not stored as separate records
  • drupal_main_image.rb - currently switching between this and a new one on these lines but could migrate old ones forward
  • drupal_file.rb - we could (with drupal_upload, below) just append files to the content of each node (which would use the Image model, actually) and get rid of these. Actually so I think we can just take the URL of the file, and add a new section to the bottom of the node, called ### Files and just make a list of the URLs to the files. I think this should work for most or all of these? Then we can delete the records -- the uploaded files themselves will remain!
  • drupal_upload.rb - this last one has no records, as far as I can tell... but links node to drupal_file so we should be able to get rid of this model and table at the same time as drupal_file.rb

Metadata

Metadata

Assignees

No one assigned

    Labels

    Rubybreak-me-upbreak up for cleaner code separation, discrete tests, and, easier and iterative collaborationdeprecationhall-of-famehelp wantedrequires help by anyone willing to contribute

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions