Skip to content
New issue

Have a question about this project? Sign up for 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

Phalcon\Mvc\Collection::save writeConcern argument should be int or string #12474

Closed
Celelibi opened this issue Dec 14, 2016 · 8 comments
Closed
Labels
bug A bug report status: low Low

Comments

@Celelibi
Copy link

Celelibi commented Dec 14, 2016

Expected and Actual Behavior

When phalcon calls the save method on a collection, it passes the array argument: ["w": true] in the file phalcon/mvc/collection.zep:912.
It should only pass an integer or a string as the documentation says.
https://secure.php.net/manual/en/mongocollection.save.php
https://secure.php.net/manual/en/mongo.writeconcerns.php

This can be a problem when the Mongo API used isn't that of the legacy mongo PHP extension.
For instance, this adapter between both mongo extensions API has a specific check and fail because of the non-conformance of phalcon to the mongo API.
https://github.com/alcaeus/mongo-php-adapter/blob/master/lib/Alcaeus/MongoDbAdapter/Helper/WriteConcernConverter.php#L27

Details

  • Phalcon version: 3.0.2
  • PHP Version: 7.0.13-2
  • Operating System: Debian stretch/sid
  • Installation type: installing via package manager
  • Server: Apache
@Jurigag
Copy link
Contributor

Jurigag commented Dec 14, 2016

Mongo extension is not supported in phalcon for php 7. Try incubator MongoCollection class.

@sergeyklay sergeyklay added this to the 4.0.0 milestone Dec 14, 2016
@Celelibi
Copy link
Author

Yeah, I know. But it's easier to use an adapter for mongo than using a development version of Phalcon. And more generally, this is a non-conformance to the mongo API, even if is usually silentely ignored.

@sergeyklay
Copy link
Contributor

It seems to me ["w": 1] can fix the issue

@Jurigag
Copy link
Contributor

Jurigag commented Dec 15, 2016

But as i told you @Celelibi collection class in phalcon 3 is only for php 5.x, not php 7.

@sergeyklay
Copy link
Contributor

sergeyklay commented Dec 15, 2016

Yea, but PHP 5.6 is LTS and 7.0 not. So we will support php5 until 2019 (for Phalcon 3)

@Jurigag
Copy link
Contributor

Jurigag commented Dec 18, 2016

Yea i know this. Just if he wants to his mongo with php 7 he needs to use class from incubator.

@stale stale bot added the stale Stale issue - automatically closed label Apr 16, 2018
@sergeyklay sergeyklay reopened this May 2, 2018
@stale stale bot removed the stale Stale issue - automatically closed label May 2, 2018
@phalcon phalcon deleted a comment from stale bot Jun 21, 2019
@niden niden removed this from the 4.0.0 milestone Jun 21, 2019
@niden
Copy link
Member

niden commented Jun 21, 2019

Related to #13697

@niden niden added the 4.0 label Jun 22, 2019
@niden niden added 4.1 and removed 4.0 labels Aug 18, 2019
@niden niden added bug A bug report status: low Low and removed Bug - Low labels Dec 23, 2019
@Jeckerson Jeckerson added 5.0 The issues we want to solve in the 5.0 release and removed 4.1.0 labels Sep 30, 2020
@zsilbi zsilbi added the transfer label Oct 6, 2020
@Jeckerson Jeckerson removed 5.0 The issues we want to solve in the 5.0 release transfer labels Mar 26, 2021
@Jeckerson
Copy link
Member

Since version 4.0 Mongo is separate composer package - https://github.com/phalcon/incubator-mongodb

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: low Low
Projects
Archived in project
Development

No branches or pull requests

6 participants