Hey, just wondering what the plans are for upgrading to D7. If you aren't planning on upgrading soon, I might have a crack at creating a patch.

Comments

infojunkie’s picture

I've no plans yet. I'd be delighted if you went for it!

naught101’s picture

Status: Active » Needs review
StatusFileSize
new3.1 KB

Well that was easy. This works. Haven't tested extensively, but it doesn't throw any errors for me..

infojunkie’s picture

Woohoo! I'll review it soon and get back to you.

naught101’s picture

by the way, this only includes the two core modules.. dunno how to download the others with CVS yet..

infojunkie’s picture

Download from DRUPAL-6--1 branch instead of HEAD.

naught101’s picture

ok, that version is significantly different. I assume the core modules should be fairly easy, but I've hit #613918: file_create_path and file_check_directory vanished with no upgrade notes - code change with no docs..

naught101’s picture

Status: Needs review » Active

#517814: File API Stream Wrapper Conversion changes a lot of things in this module, most of which are not documented. I haven't got my head around stream wrappers yet, but I will keep trying. Hopefully some documentation comes along soon though.

naught101’s picture

Assigned: Unassigned » naught101
Status: Active » Needs review
StatusFileSize
new10.81 KB

Ok, done. This is working pretty well, as far as I can tell, although I haven't tested it thoroughly.

Some changes that need to be checked:
- Graphviz_filter_process() is now graphviz_filter_filterproc(). This is because there's a new hook_process in d7. This took me days to work out, and caused extreme pain. The new name should possibly be something else.
- All path variables are now stored as public:// streams. They should probably all have their names changed to reflect that.
There might be other things that I've missed. I'm happy to update the patch once I get some feedback on the above.

cheers
ned

mccnoc’s picture

Are there any further plans to update this? Looks like a lot of functions in Drupal core have changed since this last patch was posted, and the module no longer appears to work with the 7.0 release.

Vc Developer’s picture

subscribing!.. Anybody?

naught101’s picture

Please review the patch. If there's problems (which there probably will be), report them back to this issue.

#1056784: No D7 Graphviz Filter! marked as a duplicate.

anj’s picture

The patch in #8 was not enough - I had to replace every instance of

file_directory_path()

with

file_default_scheme() . ':/'

Once that was done, it appeared to work just fine, but I'm only using it to build node reference graphs.

anj’s picture

StatusFileSize
new9.7 KB

Here are the changes I mentioned in #12, combined with the original patch from #8 to make a new patch.

clemens.tolboom’s picture

Status: Needs review » Needs work
+++ b/*.info
@@ -3,4 +3,5 @@ description = Produces a pseudo-UML class diagram of the content types using Gra
+files[] = cck_schema.module
\ No newline at end of file

All (?) .info files

+++ b/graphviz_filter.module
@@ -119,25 +115,24 @@ function graphviz_filter_file_download($file) {
+	file_delete($file->filename);

whitespace

I'm working on #1209526: Add support for graphviz_filter module. Will come back on this on.

anj’s picture

Status: Needs work » Needs review
StatusFileSize
new9.58 KB

Ok, tabs swapped for spaces in the module, and newlines appended to all info files. How's that?

clemens.tolboom’s picture

Status: Needs review » Needs work

Notice: Undefined index: PATH in _graphviz_filter_filter_settings() (line 147 of /Users/clemens/Sites/d.o.clone/downloads/graphviz_filter/graphviz_filter.module).

Trying to set the path fails.

anj’s picture

Hum, I'm afraid that's in the part of the code I didn't touch, and I don't know how to fix it. Furthermore, that line is not touched at all by the patch that I submitted, and comes from the original code, so I'm really not sure how to proceed. Sorry.

clemens.tolboom’s picture

+++ b/graphviz_filter.module
@@ -58,30 +58,25 @@ class Functor {
+function graphviz_filter_filter_info() {

Could use default settings.

http://api.drupal.org/api/drupal/modules--filter--filter.api.php/functio...

+++ b/graphviz_filter.module
@@ -58,30 +58,25 @@ class Functor {
+function _graphviz_filter_filter_process($text, $format) {
+  return preg_replace_callback(GRAPHVIZ_REGEX, Functor::create_functor('_graphviz_filter_filterproc', $format), $text);
 }

$format is not used by graphviz_filter_filterproc

function graphviz_filter_filterproc($text) {
  // Parse arguments.
  list($formats, $args) = _graphviz_filter_formats();
  _graphviz_filter_parse_args($text, $args);

Is that functor really necessary?

  $form['graphviz_filter']['graphviz_filter_dot_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Path of Graphviz commands'),
    '#default_value' => $filter->settings['graphviz_filter']['graphviz_filter_dot_path'],
    '#description' => t('Specify the base path of the Graphviz commands (`dot`, `neato`, etc). 
                         Leave blank if these commands are to be found on the system PATH which, on this server, is set to: %path',
                         array('%path' => isset($_ENV['PATH']) ? $_ENV['PATH'] : '- empty -')
                       ),
  );

I had to replace variable_get by $filter->settings[...]

My PATH is empty so changed the $_ENV

function _graphviz_filter_filter_settings($form, &$form_state, $filter, $format, $defaults, $filters) {
  //dsm(func_get_args(), __FUNCTION__);
  dsm($filter, __FUNCTION__);

function args changed according to http://api.drupal.org/api/drupal/modules--filter--filter.api.php/functio... states

Hope you could apply these throughout the module ... I'll have code for graphapi :-(

anj’s picture

As I've only been making rather superficial code changes and I'm not currently up to speed on the Drupal 7 API, I'm not really competent to answer these questions and make these changes. I'm happy to tweak and test patches, but that's all I can do right now.

TehJott’s picture

I think in graphviz-filter-d7-v4.patch line 148 should be:

+  file_prepare_directory(file_build_uri($outdir), FILE_CREATE_DIRECTORY);

instead of:

+  file_prepare_directory($outdir, FILE_CREATE_DIRECTORY);
jtbayly’s picture

subscribe

bakr’s picture

subscribe --- SUPER

infojunkie’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs work » Fixed

Committed to new D7 branch. Fixed some of the concerns in #18 and #20. Please keep this issue closed and open new issues as you encounter them.

Thanks to all contributors!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.