Comments

arthurf’s picture

Any work at this point should only focus on D7.

iva2k’s picture

Status: Active » Needs review
StatusFileSize
new72.37 KB

Core patch (copy from #52 #987000: [META] D7 port of media_mover module

The following changes are included:

  • Coder upgrade code style fixes
  • Coder upgrade Drupal API differences spotted and fixed (e.g. media_mover_ui_perm() => media_mover_ui_permission() and many others)
  • DB API cleanup, Fixed some queries that were not updated to new API, added ->execute() where was missing
  • Added define('MMA_CONFIG_PATH', 'admin/config/media/media_mover') and use it throughout. In the process a number of incorrect paths were spotted and fixed.
  • Code reviewed and some errors spotted and fixed (media_mover_api_files_get())
iva2k’s picture

StatusFileSize
new14.89 KB

This patch is from #53 for submodules mentioned in #48 #987000: [META] D7 port of media_mover module (mm_dir, mm_antiword, mm_ffmpeg, mm_compress)
It is mostly coding conventions, plus use MMA_CONFIG_PATH throughout and fix some inconsistent paths.

iva2k’s picture

StatusFileSize
new46.33 KB

This patch is from #55 for other submodules that were not converted to D7 yet (mm_export, mm_ftp, mm_getid3, mm_imageache, mm_mailhandler, mm_s3, mm_token, mm_views).

iva2k’s picture

StatusFileSize
new60.38 KB

This patch is from #54 #987000: [META] D7 port of media_mover module for mm_node and mm_utilities. It has a lot of API updates and bugfixes, but does not make them work yet. Posting here so if there is a redesign of these modules, it goes from a better starting point that is in sync with the core.

arthurf’s picture

Patch on #2 passes all of the existing tests. I'll start digging through this by hand in the next bit.

iva2k’s picture

@arthurf
I made another big effort towards getting Field API support. I made a submodule that takes files from file field and puts results of conversion back into (another) file field. It just made first successful end-to-end conversion. In the process I found and fixed some other issues in the core. So I have two pieces of new code: 1. additional fixes to the core, 2. new submodule.

Question: how do you want me to proceed?
A. I can file separate issues on every bug I find.
(there could be quite a number of those and I'm afraid it will slow me down as I will have to wait for review-commit cycle)
B. I can keep posting one big patch here for core, but that will probably delay your review of it.
C. Other approach?

arthurf’s picture

@iva2k Thanks again for all your work here. I think the way to proceed is to break out new functionality into new issues (eg: file field stuff) and have one thread for core fixes. You've clearly done lots of work and I just want to get a chance to go through it as I'm surprised to hear that you're finding so many issues.

It would also be good to break code style issues from bug fixes- maybe leave what you've done thus far but in the future break them out- this will make it faster for me to get things committed.

arthurf’s picture

I committed most of #2 along with some changes that I had in my sandbox. I ran the simple tests and did some quick tests of the UI and things looked good. I'll go back through with coder and try to get things more cleaned up later today.

iva2k’s picture

@arthurf
Re #8
For the code style fixes - I generally think it should be done once, before any other changes so everybody's life is easier. Unfortunately I did not have an opportunity to do that as I needed to get to the functionality in a short time window that I have.

BTW, did you know that you can use drupal testbot to do the style checks? you can enable the testbot for the project and then run the tests on qa.drupal.org. There will be a separate report of coding style issues. Also every submitted patch (if marked 'needs review') will be automatically tested.

Re #9
Great, I will pull git and see if I can roll incremental core patch.

As to the issues, I'm finding them, also code that looks like remnants of old APIs and old functionality. E.g. there is a function media_mover_api_dir_path1() in media_mover_api.module, but there are calls in some submodules to media_mover_api_dir_path() that does not exist. I'm finding use of $file->step in class_media_mover_file and media_mover_api.module, but no code that ever sets it.

I will work on cleaning up the new node/entity interface today (most of the day is planned for that).

API question:
Table {media_mover_files} has 'nid' column. I want to change it to two columns - 'entity_type', 'entity_id' (so any entity can be managed). There are searches needed on those, that's why I don't want to put those into 'data' blob. I can add all appropriate code: hook_update, new methods in class_media_mover_file, etc. Do you agree with the proposal?
[UPDATE] hook_update will populate entity_id = 'node' for all 'nid' set, and convert nid into entity_id.

iva2k’s picture

I also recommend committing #3 and #4 as they mostly contain cleanup and sync to the core changes. #5 does not need to be committed as mm_node is completely reworked (I think it should be named mm_field) and mm_utilities needs some major work which I'm not planning to undertake.
[UPDATE] I noticed your commit renamed MMA_CONFIG_PATH to MMA_MENU_PATH - do you want me to re-roll patches #3 and #4? There are few inconsistencies in the paths (meaning bugs) that I fixed with the replacement.

iva2k’s picture

StatusFileSize
new60.67 KB

Here's a patch for whitespace, coding style and some of the inconsistent comments fixed. It is for the whole tree including submodules to facilitate any further patches.

iva2k’s picture

Here's a patch for core menu router that:

  • cleans up menu router code
  • uses MMA_MENU_PATH throughout
  • adds MMA_MENU_PATH_LEN
  • fixes couple of issues around media_mover_ui_files_list()
iva2k’s picture

Here's a patch that applies MMA_MENU_PATH to all submodules (and fixes all found path inconsistencies). Sorry I think it belongs to core issue as it cannot be committed independently (it depends on #13).

iva2k’s picture

Here's a patch that fixes 2 core bugs:

  1. media_mover_api_file_load() name collides with core hook_file_load()
  2. media_mover_api_file_load() has caching problems - A. not using drupal_static() and B. it does not cache negative results.

    media_mover_api_file_load() renamed to media_mover_api_mmfile_load() to avoid collision with core hook_file_load().

iva2k’s picture

StatusFileSize
new15.92 KB

Here's a patch that fixes all found issues in theme and form API (as suggested by coder upgrade and code grepping and some UI tests). It covers core and submodules since it is small and fixes straightforward bugs.

iva2k’s picture

Here's a patch that fixes few issues:

  1. DB API throws PDO exception on some select statements. rewritten in new API
  2. Non-select DB queries rewritten in new API (some of them did cause PDO exception problems but I don't remember now which ones)
  3. mm_ui edit_file_form fixed
  4. mm_ui file_delete_confirm form fixed
  5. misc fixes, dead / no-op code removed
iva2k’s picture

Here's a patch that fixes bugs with incorrectly set cache in media_mover_api_configuration_machine_name_exists() and media_mover_api_step_machine_name_exists(). Also media_mover_api_configuration_code_validate() had a bug comparing $step to $step.

iva2k’s picture

StatusFileSize
new17.06 KB

Here's a patch with various fixes based on coder upgrade suggestions.

  • REQUEST_TIME (or comment why it does not apply)
  • media mover api changes (harvest => select, file->filepath => file->uri)
  • hook_perm => hook_permission
iva2k’s picture

Squeezing out last bits: patch that addresses various runtime warnings, misc typos, cleanup.

arthurf’s picture

Working through this thread slowly.... #3 is committed in full.

Status: Needs review » Needs work

The last submitted patch, media_mover_runtime_warnings_misc-1920280-20.patch, failed testing.

arthurf’s picture

Status: Needs work » Needs review

I just committed the mm_utilities portion of #5 and have deleted mm_node entirely. I just opened #1926420 which will help pull the two actions out of mm_utilities.

arthurf’s picture

I committed #12 to all the active modules.

arthurf’s picture

#13 is committed, though I changed MMA_MENU_PATH_LEN to MMA_MENU_PATH_LENGTH for readability

arthurf’s picture

Thank you for the catch on hook_file_load. #14 and #15 are committed with the static reset on file save.

arthurf’s picture

#16 is committed with some style changes.

arthurf’s picture

From #19 I only applied the changes to mm_views. I think it's ok to not comment why time() is being used in class_media_mover_file.

arthurf’s picture

Status: Needs review » Closed (fixed)

Ok- all of these have been applied. There maybe a few things I missed where I selectively took some of the changes. I'm closing this issue and lets open a new one for any specific issues that come up from here.

Thanks!

iva2k’s picture

Impressive speed! Thanks!