8000 MongoDB\generate_index_name method doesn't exist. · Issue #300 · alcaeus/mongo-php-adapter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

MongoDB\generate_index_name method doesn't exist. #300

New issue

Have a question about this project? Sign up for 8000 a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
d-soerensen opened this issue Sep 29, 2023 · 1 comment · Fixed by #301
Closed

MongoDB\generate_index_name method doesn't exist. #300

d-soerensen opened this issue Sep 29, 2023 · 1 comment · Fixed by #301
Assignees
Milestone

Comments

@d-soerensen
Copy link

There's an issue with the createIndex method inside `lib/mongo/MongoCollection.php', where in the event that the '$options' array has no property called 'name' it'll call an undefined method 'generate_index_name' from the 'MongoDB' package.

image

Additionally there's a similar error where the 'deleteIndex' method calls the same 'generate_index_name' if the '$keys' argument is an array.

image

The error I am facing:

Error Object
    (
        [message:protected] => Call to undefined function MongoDB\generate_index_name()
        [string:Error:private] => 
        [code:protected] => 0
        [file:protected] => /var/www/html/api/application/libraries/vendor/alcaeus/mongo-php-adapter/lib/Mongo/MongoCollection.php
        [line:protected] => 600
        [trace:Error:private] => Array
            (
                [0] => Array
                    (
                        [file] => /var/www/html/api/application/libraries/vendor/alcaeus/mongo-php-adapter/lib/Mongo/MongoGridFS.php
                        [line] => 340
                        [function] => createIndex
                        [class] => MongoCollection
                        [type] => ->
                        [args] => Array
                            (
                                [0] => Array
                                    (
                                        [files_id] => 1
                                        [n] => 1
                                    )

                                [1] => Array
                                    (
                                        [unique] => 1
                                    )
                            )
                    )

                [1] => Array
                    (
                        [file] => /var/www/html/api/application/libraries/vendor/alcaeus/mongo-php-adapter/lib/Mongo/MongoGridFS.php
                        [line] => 236
                        [function] => createChunksIndex
                        [class] => MongoGridFS
                        [type] => ->
                        [args] => Array
                            (
                            )
                    )

                [2] => Array
                    (
                        [file] => /var/www/html/api/application/libraries/vendor/sokil/php-mongo/src/GridFS.php
                        [line] => 59
                        [function] => storeFile
                        [class] => MongoGridFS
                        [type] => ->
                        [args] => Array
                            (
                                [0] => /var/www/html/api/uploads/form_logo/icon1.png
                                [1] => Array
                                    (
                                    )
                            )
                    )

You can refer this PR mongodb/mongo-php-library@c4569a1 for further details.

@alcaeus
Copy link
Owner
alcaeus commented Sep 29, 2023

Thanks for the report. A fix will be released shortly; in the meantime please stick with mongodb/mongodb 1.15 or lower.

@alcaeus alcaeus self-assigned this Sep 29, 2023
@alcaeus alcaeus added this to the 1.2.4 milestone Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0